{% extends shell('app') %} {% block title %}{{ _('Mail') }} - {{ _('Admin') }}{% endblock %} {% block breadcrumb %} {% endblock %} {% macro mail_rows(mails, actions) %}
{% if actions %}{% endif %} {% for mail in mails %} {% if actions %} {% endif %} {% endfor %}
{{ _('Created') }} {{ _('To') }} {{ _('Subject') }} {{ _('Attempts') }} {{ _('Last error') }}{{ _('Actions') }}
{{ mail.created_at.strftime('%Y-%m-%d %H:%M') if mail.created_at else '' }} {{ mail.recipients }} {{ mail.subject }} {% if not mail.retryable %}
{{ _('Carried a link') }}
{% endif %}
{{ mail.attempts }} {{ mail.last_error or '' }} {% if mail.retryable %}
{{ action_form.hidden_tag() }}
{% endif %}
{{ action_form.hidden_tag() }}
{% endmacro %} {% block content %}

{{ _('Mail') }}

{{ _('Every mail the site sends goes through the outbox. Here are the ones that failed and the ones waiting for another attempt.') }} {{ _('%(sent)s sent, %(waiting)s on their way, %(failed)s failed.', sent=counts['sent'], waiting=counts['queued'] + counts['sending'], failed=counts['failed']) }}

{% with messages = get_flashed_messages(with_categories=true) %} {% for category, message in messages %} {% endfor %} {% endwith %}

{{ _('Failed') }}

{% if failed %}

{{ _('Nothing more is tried for these. Send one again once the reason is fixed (the server, MAIL_* in the deployment), or discard it.') }}

{{ mail_rows(failed, True) }} {% else %}
{{ _('No mail has failed.') }}
{% endif %}

{{ _('Waiting for another attempt') }}

{% if waiting %}

{{ _('Tried and not sent yet. Each one is tried up to %(attempts)s times, over about half an hour.', attempts=max_attempts) }}

{{ mail_rows(waiting, False) }} {% else %}
{{ _('No mail is waiting for another attempt.') }}
{% endif %} {% endblock %}