{% from "leeuwenhoek/_macros.html" import time_ago %} {% macro head() %}SubjectToAttachmentsWhen{% endmacro %} {% macro row(e) %} {{ e.content.subject | lw_truncate(90) }} {{ e.content.to | join(", ") | lw_truncate(60) }} {% if e.content.attachments %}{{ e.content.attachments | length }}{% endif %} {{ time_ago(e.created_at) }} {% endmacro %} {% macro summary(e) %}mail {{ e.content.subject | lw_truncate(80) }} to {{ e.content.to | join(", ") | lw_truncate(60) }}{% endmacro %} {% macro detail(e) %} {% set c = e.content %} {% for label, key in [("To", "to"), ("Cc", "cc"), ("Bcc", "bcc")] %} {% if c[key] %}{% endif %} {% endfor %} {% if c.reply_to %}{% endif %} {% if c.attachments %}{% endif %} {% for k, v in (c.headers or {}).items() %}{% endfor %}
Subject{{ c.subject }}
From{{ c.sender or "—" }}
{{ label }}{{ c[key] | join(", ") }}
Reply-To{{ c.reply_to }}
Attachments {% for a in c.attachments %}{{ a.filename or "(unnamed)" }} {{ a.content_type }}{% endfor %}
{{ k }}{{ v }}
{% if c.html %}

HTML

{# Empty sandbox: no scripts, no same-origin, no forms, no popups. srcdoc is autoescaped. #}
HTML source
{{ c.html }}
{% endif %} {% if c.text %}

Text

{{ c.text }}
{% endif %} {% if not c.html and not c.text %}

No body.

{% endif %} {% endmacro %}