From c975ea1f4a6a89f44f601b70d4e8aa85660cf058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Egyed?= Date: Wed, 15 Feb 2023 23:06:14 +0100 Subject: [PATCH] [WebProfilerBundle] Tweak Mailer panel rendering --- Resources/views/Collector/mailer.html.twig | 36 ++++++++++------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/Resources/views/Collector/mailer.html.twig b/Resources/views/Collector/mailer.html.twig index 651c2a16..a42b8b33 100644 --- a/Resources/views/Collector/mailer.html.twig +++ b/Resources/views/Collector/mailer.html.twig @@ -90,8 +90,8 @@ {% for event in collector.events.events(transport) %} {{ loop.index }} - {{ event.message.headers.get('subject').bodyAsString() ?? '(No subject)' }} - {{ (event.message.headers.get('to').bodyAsString() ?? '(empty)')|replace({'To:': ''}) }} + {{ event.message.getSubject() ?? '(No subject)' }} + {{ event.message.getTo()|map(addr => addr.toString())|join(', ')|default('(empty)') }} {% endfor %} @@ -137,12 +137,12 @@

- {{ message.headers.get('subject').bodyAsString() ?? '(No subject)' }} + {{ message.getSubject() ?? '(No subject)' }}

-

From: {{ (message.headers.get('from').bodyAsString() ?? '(empty)')|replace({'From:': ''}) }}

-

To: {{ (message.headers.get('to').bodyAsString() ?? '(empty)')|replace({'To:': ''}) }}

- {% for header in message.headers.all|filter(header => (header.name ?? '') not in ['Subject', 'From', 'To']) %} +

From: {{ message.getFrom()|map(addr => addr.toString())|join(', ')|default('(empty)') }}

+

To: {{ message.getTo()|map(addr => addr.toString())|join(', ')|default('(empty)') }}

+ {% for header in message.headers.all|filter(header => (header.name ?? '')|lower not in ['subject', 'from', 'to']) %}

{{ header.toString }}

{% endfor %}
@@ -182,6 +182,17 @@
{% if message.htmlBody %} {% set htmlBody = message.htmlBody() %} +
+

HTML preview

+
+ +
+
+

HTML content

@@ -194,19 +205,6 @@
- -
-

HTML preview

-
-
-                                                    
-                                                
-
-
{% endif %} {% if message.textBody %}