{% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} {% set events = collector.events %} {% if events.messages|length %} {% set icon %} {% include('@WebProfiler/Icon/mailer.svg') %} {{ events.messages|length }} {% endset %} {% set text %}
Sent messages {{ events.messages|length }}
{% for transport in events.transports %}
{{ transport }} {{ events.messages(transport)|length }}
{% endfor %} {% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': profiler_url }) }} {% endif %} {% endblock %} {% block head %} {{ parent() }} {% endblock %} {% block menu %} {% set events = collector.events %} {{ include('@WebProfiler/Icon/mailer.svg') }} E-mails {% if events.messages|length > 0 %} {{ events.messages|length }} {% endif %} {% endblock %} {% block panel %} {% set events = collector.events %}

Emails

{% if not events.messages|length %}

No emails were sent.

{% endif %}
{% for transport in events.transports %}
{{ events.messages(transport)|length }} {{ events.messages(transport)|length == 1 ? 'message' : 'messages' }}
{% endfor %}
{% for transport in events.transports %}

{{ transport }}

{% for event in events.events(transport) %} {% set message = event.message %}

Email #{{ loop.index }} ({{ event.isQueued() ? 'queued' : 'sent' }})

{% if message.headers is not defined %} {# RawMessage instance #}
{{ message.toString() }}
{% else %} {# Message instance #}
Subject

{{ message.headers.get('subject').bodyAsString() ?? '(empty)' }}

From
{{ (message.headers.get('from').bodyAsString() ?? '(empty)')|replace({'From:': ''}) }}
To
{{ (message.headers.get('to').bodyAsString() ?? '(empty)')|replace({'To:': ''}) }}
Headers
{% for header in message.headers.all|filter(header => (header.name ?? '') not in ['Subject', 'From', 'To']) %}
                                                    {{- header.toString }}
                                                {%~ endfor %}
{% if message.htmlBody is defined %} {# Email instance #}

HTML Content

                                                            {%- if message.htmlCharset() %}
                                                                {{- message.htmlBody()|convert_encoding('UTF-8', message.htmlCharset()) }}
                                                            {%- else %}
                                                                {{- message.htmlBody() }}
                                                            {%- endif -%}
                                                        

Text Content

                                                            {%- if message.textCharset() %}
                                                                {{- message.textBody()|convert_encoding('UTF-8', message.textCharset()) }}
                                                            {%- else %}
                                                                {{- message.textBody() }}
                                                            {%- endif -%}
                                                        
{% for attachment in message.attachments %}

Attachment #{{ loop.index }}

{{ attachment.toString() }}
{% endfor %} {% endif %}

Parts Hierarchy

{{ message.body().asDebugString() }}

Raw

{{ message.toString() }}
{% endif %}
{% endfor %}
{% endfor %} {% endblock %}