8000 bug #53934 [Mailer] Fix signed emails breaking the profiler (HypeMC) · symfony/symfony@0984e3b · GitHub
[go: up one dir, main page]

Skip to content

Commit 0984e3b

Browse files
bug #53934 [Mailer] Fix signed emails breaking the profiler (HypeMC)
This PR was merged into the 5.4 branch. Discussion ---------- [Mailer] Fix signed emails breaking the profiler | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #53928 | License | MIT Commits ------- b202d65 [Mailer] Fix signed emails breaking the profiler
2 parents f19f4eb + b202d65 commit 0984e3b

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/mailer.html.twig

+31-3
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,35 @@
121121
<h3 class="tab-title">Headers</h3>
122122
<div class="tab-content">
123123
<span class="label">Subject</span>
124-
<h2 class="m-t-10">{{ message.getSubject() ?? '(empty)' }}</h2>
124+
{% if message.subject is defined %}
125+
{# Email instance #}
126+
<h2 class="m-t-10">{{ message.getSubject() ?? '(empty)' }}</h2>
127+
{% elseif message.headers.has('subject') %}
128+
<h2 class="m-t-10">{{ message.headers.get('subject').toString()|split(': ', 2)[1]|default('(empty)') }}</h2>
129+
{% else %}
130+
<h2 class="m-t-10">(empty)</h2>
131+
{% endif %}
125132
<div class="row">
126133
<div class="col col-4">
127134
<span class="label">From</span>
128-
<pre class="prewrap">{{ message.getFrom()|map(addr => addr.toString())|join(', ')|default('(empty)') }}</pre>
135+
{% if message.from is defined %}
136+
{# Email instance #}
137+
<pre class="prewrap">{{ message.getFrom()|map(addr => addr.toString())|join(', ')|default('(empty)') }}</pre>
138+
{% elseif message.headers.has('from') %}
139+
<pre class="prewrap">{{ message.headers.get('from').toString()|split(': ', 2)[1]|default('(empty)') }}</pre>
140+
{% else %}
141+
<pre class="prewrap">(empty)</pre>
142+
{% endif %}
129143

130144
<span class="label">To</span>
131-
<pre class="prewrap">{{ message.getTo()|map(addr => addr.toString())|join(', ')|default('(empty)') }}</pre>
145+
{% if message.to is defined %}
146+
{# Email instance #}
147+
<pre class="prewrap">{{ message.getTo()|map(addr => addr.toString())|join(', ')|default('(empty)') }}</pre>
148+
{% elseif message.headers.has('to') %}
149+
<pre class="prewrap">{{ message.headers.get('to').toString()|split(': ', 2)[1]|default('(empty)') }}</pre>
150+
{% else %}
151+
<pre class="prewrap">(empty)</pre>
152+
{% endif %}
132153
</div>
133154
<div class="col">
134155
<span class="label">Headers</span>
@@ -191,6 +212,13 @@
191212
</div>
192213
</div>
193214
{% endfor %}
215+
{% else %}
216+
<div class="tab">
217+
<h3 class="tab-title">Content</h3>
218+
<div class="tab-content">
219+
<pre class="prewrap" style="max-height: 600px">{{ message.body().toString() }}</pre>
220+
</div>
221+
</div>
194222
{% endif %}
195223
<div class="tab">
196224
<h3 class="tab-title">Parts Hierarchy</h3>

0 commit comments

Comments
 (0)
0