{% if email.content_type.is_singlepart() %}
{{ email.body|safe }}
{% else %}
{% for part in email.parts %}
{% if part.is_body() %}
{# and part.content_type.value in ['text/plain', 'text/html'] #}
Partie : {{ loop.index }} - {{ part.content_type.value }} : ({{part.size|filesizeformat}})
{{ part.body }}
{% elif part.detected_file_name %}
Partie : {{ loop.index }} - {{ part.detected_file_name }} : ({{part.size|filesizeformat}})
{% else %}
Partie : {{ loop.index }} - {{ part.content_type.value }}
{% endif %}
{% endfor %}
{% endif %}
{% endblock body %}
{% block tail %}
{{ super() }}
{% endblock tail %}