{% extends "django_mail_preview/base.html" %} {% load mail_preview %} {% block pane %}
{% if sent %}

Inbox {{ sent|length }}

{# The search box needs the script and shows once it has run; the query stays in the URL, so a reload keeps it. #}
{% if tags %} {# Every tag of the listed mail with its count. A click puts tag: into the box, so the row needs the script too. #}
{% for tag, count in tags %} {% endfor %}
{% endif %} {% for item in sent %} {# The row carries every tag for the script; the cell shows three and counts the rest, with the names in the tooltip. #} {% endfor %}
Subject From To Attachments Size Time
{{ item.meta.subject|default:"(no subject)" }}{% if item.meta.tags %}{% for tag in item.meta.tags|slice:":3" %}{% endfor %}{% if item.meta.tags|length > 3 %}+{{ item.meta.tags|length|add:"-3" }}{% endif %}{% endif %} {{ item.meta.from_email }} {{ item.meta.to|join:", " }} {% if item.meta.attachments %} {% include "django_mail_preview/_clip.html" %}{{ item.meta.attachments }} {% endif %} {{ item.meta.size|filesizeformat }}
{% else %} {# The empty inbox: one glyph, one sentence, the one command that changes it. #}

Your inbox is empty

{% if backend_active %}

Send a message from your project and it appears here.

python manage.py shell -c "from django.core.mail import send_mail; send_mail('Hello', 'It works.', 'me@example.com', ['you@example.com'])"
{% else %}

Point your project at the capture backend and every message it sends appears here.

# settings.py
{% if mailers %}MAILERS = {
    "default": {"BACKEND": "django_mail_preview.backends.EmailBackend"},
}{% else %}EMAIL_BACKEND = "django_mail_preview.backends.EmailBackend"{% endif %}
{% endif %} {% if not previews %}

No previews yet? Add a previews.py to render your templates with sample data.

{% endif %}
{% endif %}
{% endblock pane %}