Skip to content

Commit

Permalink
bug #49400 [WebProfilerBundle] Tweak Mailer panel rendering (1ed)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 6.2 branch.

Discussion
----------

[WebProfilerBundle] Tweak Mailer panel rendering

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

**Before**

![Screenshot from 2023-02-15 23-03-29](https://user-images.githubusercontent.com/162986/219187282-dfdb3593-6e1c-476e-b8de-38a08e476f05.png)

**After**

![Screenshot from 2023-02-15 23-04-05](https://user-images.githubusercontent.com/162986/219187623-65045794-67b5-4f2c-af6e-30e01adaad62.png)

Commits
-------

126678b9ae [WebProfilerBundle] Tweak Mailer panel rendering
  • Loading branch information
fabpot committed Feb 17, 2023
2 parents d5b8170 + c975ea1 commit 09d1284
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions Resources/views/Collector/mailer.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
{% for event in collector.events.events(transport) %}
<tr class="mailer-email-summary-table-row {{ loop.first ? 'active' }}" data-target="#email-{{ loop.index }}">
<td>{{ loop.index }}</td>
<td>{{ event.message.headers.get('subject').bodyAsString() ?? '(No subject)' }}</td>
<td>{{ (event.message.headers.get('to').bodyAsString() ?? '(empty)')|replace({'To:': ''}) }}</td>
<td>{{ event.message.getSubject() ?? '(No subject)' }}</td>
<td>{{ event.message.getTo()|map(addr => addr.toString())|join(', ')|default('(empty)') }}</td>
<td class="visually-hidden"><button class="mailer-email-summary-table-row-button" data-target="#email-{{ loop.index }}">View email details</button></td>
</tr>
{% endfor %}
Expand Down Expand Up @@ -137,12 +137,12 @@
<div class="tab-content">
<div class="card-block">
<p class="mailer-message-subject">
{{ message.headers.get('subject').bodyAsString() ?? '(No subject)' }}
{{ message.getSubject() ?? '(No subject)' }}
</p>
<div class="mailer-message-headers">
<p><strong>From:</strong> {{ (message.headers.get('from').bodyAsString() ?? '(empty)')|replace({'From:': ''}) }}</p>
<p><strong>To:</strong> {{ (message.headers.get('to').bodyAsString() ?? '(empty)')|replace({'To:': ''}) }}</p>
{% for header in message.headers.all|filter(header => (header.name ?? '') not in ['Subject', 'From', 'To']) %}
<p><strong>From:</strong> {{ message.getFrom()|map(addr => addr.toString())|join(', ')|default('(empty)') }}</p>
<p><strong>To:</strong> {{ message.getTo()|map(addr => addr.toString())|join(', ')|default('(empty)') }}</p>
{% for header in message.headers.all|filter(header => (header.name ?? '')|lower not in ['subject', 'from', 'to']) %}
<p class="mailer-message-header-secondary">{{ header.toString }}</p>
{% endfor %}
</div>
Expand Down Expand Up @@ -182,6 +182,17 @@
<div class="sf-tabs sf-tabs-sm">
{% if message.htmlBody %}
{% set htmlBody = message.htmlBody() %}
<div class="tab">
<h3 class="tab-title">HTML preview</h3>
<div class="tab-content">
<iframe
src="data:text/html;charset=utf-8;base64,{{ collector.base64Encode(htmlBody) }}"
style="height: 80vh;width: 100%;max-height: 600px;"
>
</iframe>
</div>
</div>

<div class="tab">
<h3 class="tab-title">HTML content</h3>
<div class="tab-content">
Expand All @@ -194,19 +205,6 @@
</pre>
</div>
</div>

<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>
{% endif %}

{% if message.textBody %}
Expand Down

0 comments on commit 09d1284

Please sign in to comment.