Skip to content

[WebProfilerBundle] fix Email HTML preview #44714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,42 +141,48 @@
</div>
{% if message.htmlBody is defined %}
{# Email instance #}
<div class="tab">
<h3 class="tab-title">HTML preview</h3>
<div class="tab-content">
<pre class="prewrap" style="max-height: 600px">
<iframe
src="data:text/html;base64;charset=utf-8,{{ collector.base64Encode(message.htmlBody()) }}"
style="height: 80vh;width: 100%;"
>
</iframe>
</pre>
{% set htmlBody = message.htmlBody() %}
{% if htmlBody is not null %}
<div class="tab">
<h3 class="tab-title">HTML Preview</h3>
<div class="tab-content">
<pre class="prewrap" style="max-height: 600px">
<iframe
src="data:text/html;charset=utf-8;base64,{{ collector.base64Encode(htmlBody) }}"
style="height: 80vh;width: 100%;"
>
</iframe>
</pre>
</div>
</div>
</div>
<div class="tab">
<h3 class="tab-title">HTML Content</h3>
<div class="tab-content">
<pre class="prewrap" style="max-height: 600px">
{%- if message.htmlCharset() %}
{{- message.htmlBody()|convert_encoding('UTF-8', message.htmlCharset()) }}
{%- else %}
{{- message.htmlBody() }}
{%- endif -%}
</pre>
<div class="tab">
<h3 class="tab-title">HTML Content</h3>
<div class="tab-content">
<pre class="prewrap" style="max-height: 600px">
{%- if message.htmlCharset() %}
{{- htmlBody|convert_encoding('UTF-8', message.htmlCharset()) }}
{%- else %}
{{- htmlBody }}
{%- endif -%}
</pre>
</div>
</div>
</div>
<div class="tab">
<h3 class="tab-title">Text Content</h3>
<div class="tab-content">
<pre class="prewrap" style="max-height: 600px">
{%- if message.textCharset() %}
{{- message.textBody()|convert_encoding('UTF-8', message.textCharset()) }}
{%- else %}
{{- message.textBody() }}
{%- endif -%}
</pre>
{% endif %}
{% set textBody = message.textBody() %}
{% if textBody is not null %}
<div class="tab">
<h3 class="tab-title">Text Content</h3>
<div class="tab-content">
<pre class="prewrap" style="max-height: 600px">
{%- if message.textCharset() %}
{{- textBody|convert_encoding('UTF-8', message.textCharset()) }}
{%- else %}
{{- textBody }}
{%- endif -%}
</pre>
</div>
</div>
</div>
{% endif %}
{% for attachment in message.attachments %}
<div class="tab">
<h3 class="tab-title">Attachment #{{ loop.index }}</h3>
Expand Down