Permalink
Browse files

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.
  • Loading branch information...
1 parent f42af67 commit 750f809d6fa97fd78c75a1367040527db82b6b45 @alex88 alex88 committed Mar 25, 2013
Showing with 12 additions and 0 deletions.
  1. +12 −0 Resources/views/Collector/swiftmailer.html.twig
@@ -54,6 +54,18 @@
{%- endif -%}
</pre>
</p>
+ {% for messagePart in message.children if messagePart.contentType == 'text/plain' or messagePart.contentType == 'text/html' %}
+ <h4>Alternative part</h4>
+ <p>
+ <pre>
+ {%- if messagePart.charset %}
+ {{- messagePart.body|e('html', messagePart.charset)|convert_encoding('UTF-8', messagePart.charset) }}
+ {%- else %}
+ {{- messagePart.body|e('html') }}
+ {%- endif -%}
+ </pre>
+ </p>
+ {% endfor %}
{% endfor %}
{% endif %}
{% endblock %}

0 comments on commit 750f809

Please sign in to comment.