{# The Email section for one account (milestone 495): its address, and whether it gets alert emails and the weekly report. A section of the page's one form, saved by that form's Save: the Account page (your own) and an account's page in Settings › Users (an admin's view, whose address sits with its name). `defaults` is {kind: bool}, the account's role defaults; `zone_note` says whose zone the emails' times are in. #} {% macro email_section(user, defaults, zone_note, with_address=true, unreachable=false) -%}

Email

{% if with_address %}
{% if user.auth_source != "local" %}Your sign-in provider set this first; change it if mail doesn't reach it.{% endif %}
{% elif unreachable %}

{{ user.email }} isn't an address mail can reach, so this account gets no email. Set a real one above.

{% endif %}
{% for kind, label in (("alerts", "Alert emails"), ("report", "Weekly report")) %} {% set choice = user["notify_" ~ kind] %}
{% endfor %}

Times in these emails are in {{ zone_note }}. {% if session.user_role == "admin" %}Each role's default is set in Settings › Notifications. {%- else %}An admin sets each role's default.{% endif %}

{%- endmacro %}