{% 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 %}
Queued messages {{ events.events|filter(e => e.isQueued())|length }}
Sent messages {{ events.events|filter(e => not e.isQueued())|length }}
{% 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 %}
{{ events.events|filter(e => e.isQueued())|length }} Queued
{{ events.events|filter(e => not e.isQueued())|length }} Sent
{% for transport in events.transports %}
{% for event in events.events(transport) %} {% set message = event.message %}

Email {{ event.isQueued() ? 'queued' : 'sent via ' ~ transport }}

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

Headers

Subject {% if message.subject is defined %} {# Email instance #}

{{ message.getSubject() ?? '(empty)' }}

{% elseif message.headers.has('subject') %}

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

{% else %}

(empty)

{% endif %}
From {% if message.from is defined %} {# Email instance #}
{{ message.getFrom()|map(addr => addr.toString())|join(', ')|default('(empty)') }}
{% elseif message.headers.has('from') %}
{{ message.headers.get('from').bodyAsString()|default('(empty)') }}
{% else %}
(empty)
{% endif %} To {% if message.to is defined %} {# Email instance #}
{{ message.getTo()|map(addr => addr.toString())|join(', ')|default('(empty)') }}
{% elseif message.headers.has('to') %}
{{ message.headers.get('to').bodyAsString()|default('(empty)') }}
{% else %}
(empty)
{% endif %}
Headers
{% for header in message.headers.all|filter(header => (header.name ?? '')|lower not in ['subject', 'from', 'to']) %}
                                                                {{- header.toString }}
                                                            {%~ endfor %}
{% if message.htmlBody is defined %} {# Email instance #} {% set htmlBody = message.htmlBody() %} {% if htmlBody is not null %}

HTML Preview

                                                                
                                                            

HTML Content

                                                                {%- if message.htmlCharset() %}
                                                                    {{- htmlBody|convert_encoding('UTF-8', message.htmlCharset()) }}
                                                                {%- else %}
                                                                    {{- htmlBody }}
                                                                {%- endif -%}
                                                            
{% endif %} {% set textBody = message.textBody() %} {% if textBody is not null %}

Text Content

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

Attachment #{{ loop.index }}

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

Content

{{ message.body().toString() }}
{% endif %}

Parts Hierarchy

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

Raw

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