{% extends "cms/base.html" %} {% block title %}Correspondences{% endblock title %} {% block page_title %}Correspondences{% endblock %} {% block extra_head %} {% endblock %} {% block cms_content %}

{% if show_archived %}Archived Correspondences{% else %}Correspondences{% endif %} ({{ total }})

{% if type_filter %}{% endif %} {% if status_filter %}{% endif %} {% if show_archived %}{% endif %} {% if search %}✕{% endif %}
{% if show_archived %} Active {% else %} Archived{% if archived_count %} ({{ archived_count }}){% endif %} {% endif %}
{% if page_obj or type_filter or status_filter %}
Filter by Type
All {{ total }} {% for val, lbl, cnt in type_choices_with_counts %} {{ lbl }} {{ cnt }} {% endfor %} Sent {{ sent_count }} Failed {{ fail_count }}
{% endif %} {% if page_obj %} {% for email in page_obj %} {% endfor %} {% endif %}
{% if page_obj %} {% for email in page_obj %} {% endfor %}
# Subject To Type Status Sent Actions
{{ email.pk }} {{ email.subject }} {{ email.to_email }} {% if email.email_type == 'order_confirmation' %} Order {% elif email.email_type == 'order_cancellation' %} Cancellation {% elif email.email_type == 'admin_notification' %} Admin {% elif email.email_type == 'quote' %} Quote {% elif email.email_type == 'deal' %} Deal {% elif email.email_type == 'otp' %} OTP {% else %} {{ email.get_email_type_display }} {% endif %} {% if email.ok %} Sent {% else %} Failed {% endif %} {{ email.sent_at|date:"d M Y, H:i" }} {% if show_archived %} {% else %} {% endif %}
{% if page_obj.has_other_pages %}
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} — {{ page_obj.paginator.count }} emails
{% if page_obj.has_previous %} {% endif %} {% for num in page_obj.paginator.page_range %} {% if num == page_obj.number %} {{ num }} {% elif num >= page_obj.number|add:'-2' and num <= page_obj.number|add:'2' %} {{ num }} {% endif %} {% endfor %} {% if page_obj.has_next %} {% endif %}
{% endif %} {% else %}
{% if search or type_filter or status_filter %}No emails match your filters.{% else %}No emails logged yet. They appear here automatically once the system sends them.{% endif %}
{% endif %}
{% endblock cms_content %} {% block extra_js %} {% endblock %}