This commit is contained in:
jpmvaz
2026-09-13 20:03:24 +01:00
commit 0ebb8e7f4b
270 changed files with 23789 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
{% extends "base.html" %}
{% block title %}Mail status — MartinhalApprovalFlow{% endblock %}
{% block content %}
<h1>Mail status</h1>
<p class="sub">Every email the app tried to send, with its delivery result and whether a copy was saved to the Sent folder.</p>
{% if not configured %}
<div class="flash error">Mail account not configured — <span class="mono">MAIL_USER</span> is empty, so messages are printed to the server console (dev mode) instead of being sent.</div>
{% endif %}
<div class="stats">
<div class="stat"><b>{{ stats.get('sent', 0) }}</b><span>Sent</span></div>
<div class="stat"><b>{{ stats.get('error', 0) }}</b><span>Errors</span></div>
<div class="stat"><b>{{ copy_fails }}</b><span>Sent-copy failures</span></div>
<div class="stat"><b>{{ stats.get('dev', 0) }}</b><span>Dev mode</span></div>
</div>
<div class="card">
<table>
<tr><th>When</th><th>To</th><th>Subject</th><th>Request</th><th>Delivery</th><th>Sent folder</th></tr>
{% for m in rows %}
<tr>
<td class="mono muted">{{ m.at }}</td>
<td class="mono">{{ m.recipients }}</td>
<td>{{ m.subject }}
{% if m.detail %}<br><span class="muted">{{ m.detail }}</span>{% endif %}</td>
<td class="mono">{% if m.request_id %}<a href="{{ url_for('admin_request', rid=m.request_id) }}">#{{ m.request_id }}</a>{% else %}—{% endif %}</td>
<td>
{% if m.status == 'sent' %}<span class="stamp approved">sent</span>
{% elif m.status == 'error' %}<span class="stamp denied">error</span>
{% else %}<span class="stamp pending">dev</span>{% endif %}
</td>
<td>
{% if m.sent_copy.startswith('saved') %}<span class="chip">{{ m.sent_copy }}</span>
{% elif m.sent_copy.startswith('failed') %}<span class="stamp denied">copy failed</span><br><span class="muted">{{ m.sent_copy }}</span>
{% else %}<span class="muted">{{ m.sent_copy }}</span>{% endif %}
</td>
</tr>
{% else %}
<tr><td colspan="6" class="muted">No mail has been sent yet.</td></tr>
{% endfor %}
</table>
</div>
{% endblock %}