Skip to content
This repository was archived by the owner on Feb 6, 2022. It is now read-only.

Commit 750f809

Browse files
committed
Added alternative mail formats view
Added a foreach on swiftmailer message parts to display also the alternate text/html text/plain version of the message.
1 parent f42af67 commit 750f809

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Resources/views/Collector/swiftmailer.html.twig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@
5454
{%- endif -%}
5555
</pre>
5656
</p>
57+
{% for messagePart in message.children if messagePart.contentType == 'text/plain' or messagePart.contentType == 'text/html' %}
58+
<h4>Alternative part</h4>
59+
<p>
60+
<pre>
61+
{%- if messagePart.charset %}
62+
{{- messagePart.body|e('html', messagePart.charset)|convert_encoding('UTF-8', messagePart.charset) }}
63+
{%- else %}
64+
{{- messagePart.body|e('html') }}
65+
{%- endif -%}
66+
</pre>
67+
</p>
68+
{% endfor %}
5769
{% endfor %}
5870
{% endif %}
5971
{% endblock %}

0 commit comments

Comments
 (0)