{% extends "ui/templates/base/layout.html" %} {% block content %}

Email Audit Dashboard

Monitor SMTP delivery, retry queue, incoming IMAP messages, template activity and email-to-work mapping health.

SMTP Status
{{ 'Ready' if smtp_configured else 'Pending' }}
{% if smtp_configured %} Configured {% else %} Needs setup {% endif %}

{{ setting.smtp_host if setting and setting.smtp_host else 'SMTP host not configured' }}

Sent in 24 Hours
{{ summary.sent_24h }}

Last 7 days sent: {{ summary.sent_7d }}

Failed in 24 Hours
{{ summary.failed_24h }}

Last 7 days failed: {{ summary.failed_7d }}

Queue Pending
{{ summary.pending_now }}

Retryable: {{ summary.queue_retryable }} | Exhausted: {{ summary.queue_exhausted }}

IMAP Status
{{ 'Ready' if imap_configured else 'Pending' }}
{% if imap_configured %} Configured {% else %} Needs setup {% endif %}

{{ setting.imap_host if setting and setting.imap_host else 'IMAP host not configured' }}

Incoming Emails
{{ summary.incoming_7d }}

Fetched in last 7 days

Unmapped Incoming
{{ summary.incoming_unmapped }}

Mapped: {{ summary.incoming_mapped }}

Templates
{{ summary.active_templates }}

Inactive: {{ summary.inactive_templates }}

7-Day Delivery Summary

Generated: {{ generated_at }}
{% for row in status_summary %} {% else %} {% endfor %}
StatusCount
{{ row.status }}{{ row.count }}
No email activity in the last 7 days.

Template Activity

{% for row in template_summary_rows %} {% else %} {% endfor %}
TemplateSentFailedPendingTotal
{{ row.template_code }} {{ row.SENT }} {{ row.FAILED }} {{ row.PENDING }} {{ row.total }}
No template-wise activity found.

Recent Failed Emails

View logs
{% for log in recent_failed %}
{{ log.recipient_email }}
{{ log.subject }}
{{ log.error_message or 'No error message stored.' }}
{% else %}
No recent failed emails.
{% endfor %}

Queue Attention

Process queue
{% for log in queue_due %}
{{ log.status }}{{ log.attempt_count }}/{{ log.max_attempts }}
{{ log.recipient_email }}
{{ log.subject }}
{% else %}
No pending retry items.
{% endfor %}

Incoming Mapping Attention

Open inbox
{% for mail in incoming_attention %}
{{ mail.sender_email or '-' }}{{ mail.mapping_status }}
{{ mail.subject or '(No subject)' }}
Attachments: {{ mail.attachment_count }}
{% else %}
No unmapped incoming emails needing attention.
{% endfor %}
{% endblock %}