Files
2026-09-13 19:59:54 +01:00

74 lines
3.1 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}Mail log{% endblock %}
{% block content %}
<div class="section-head">
<div>
<span class="section-tag">// console mail log</span>
<h1>Mail log</h1>
<p class="lead">Every message the platform has dispatched, whether a copy reached the Sent folder, and its delivery result. Most-recent first.</p>
</div>
<div class="log-actions">
<a href="{{ url_for('backoffice.mail_log_export') }}" class="btn btn-ghost">⬇ Export CSV</a>
<form method="post" action="{{ url_for('backoffice.mail_log_email') }}" class="log-email-form" novalidate>
{{ log_email_form.csrf_token }}
{{ log_email_form.log_recipient(placeholder="destination@example.com") }}
{{ log_email_form.submit(class_="btn btn-primary") }}
</form>
</div>
</div>
<table class="table">
<thead>
<tr>
<th>Timestamp (UTC)</th><th>Kind</th><th>Recipients</th><th>Subject</th>
<th>Status</th><th>Sent copy</th><th>By</th><th>Info</th>
</tr>
</thead>
<tbody>
{% for m in pagination.items %}
<tr>
<td class="mono dim" style="font-size: .82rem; white-space: nowrap;">{{ m.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</td>
<td><span class="mono" style="color: var(--info);">{{ m.kind }}</span></td>
<td class="dim" style="font-size: .85rem;">{{ m.recipients or '—' }}</td>
<td>{{ m.subject or '—' }}</td>
<td>
{% if m.status == 'sent' %}
<span class="status-badge status-active"><span class="led"></span>sent</span>
{% else %}
<span class="status-badge" style="color: var(--danger);"><span class="led" style="background: var(--danger);"></span>failed</span>
{% endif %}
</td>
<td>
{% if m.sent_copy == 'saved' %}
<span class="mono" style="color: var(--accent);">saved</span>
{% elif m.sent_copy == 'failed' %}
<span class="mono" style="color: var(--danger);">failed</span>
{% elif m.sent_copy == 'disabled' %}
<span class="mono dim">disabled</span>
{% else %}
<span class="mono dim"></span>
{% endif %}
</td>
<td class="mono dim" style="font-size: .82rem;">{{ m.triggered_by or 'system' }}</td>
<td class="dim" style="font-size: .8rem;">{{ m.info or '' }}</td>
</tr>
{% else %}
<tr><td colspan="8" class="dim" style="text-align: center; padding: 32px;">No mail has been sent yet.</td></tr>
{% endfor %}
</tbody>
</table>
{% if pagination.pages > 1 %}
<div class="pagination">
{% if pagination.has_prev %}<a href="{{ url_for('backoffice.mail_log', page=pagination.prev_num) }}"> prev</a>{% endif %}
{% for p in pagination.iter_pages(left_edge=1, right_edge=1, left_current=2, right_current=2) %}
{% if p %}
{% if p == pagination.page %}<span class="current">{{ p }}</span>
{% else %}<a href="{{ url_for('backoffice.mail_log', page=p) }}">{{ p }}</a>{% endif %}
{% else %}<span></span>{% endif %}
{% endfor %}
{% if pagination.has_next %}<a href="{{ url_for('backoffice.mail_log', page=pagination.next_num) }}">next </a>{% endif %}
</div>
{% endif %}
{% endblock %}