Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 6.4:
  [TwigBridge] foundation 5 layout: use form_label_content block for checkbox and radio labels
  [TwigBridge] Fix compat with Twig v3.9
  [Cache] Sync the Redis proxies with upstream
  [Doctrine Messenger] Fix support for pgsql + pgbouncer.
  [Mailer] Simplify fix
  Do not produce notice/warning when consuming from multiple transports and explicitly listed queues
  [FrameworkBundle] Check if the _route attribute exists on the request
  [Scheduler] fix documentation link
  [PropertyAccess] Fixes getValue() on an unitialized object property on a lazy ghost
  [HttpClient] Make retry strategy work again
  AssetMapper: Remove 'auto-generated' info
  [Mailer] Fix signed emails breaking the profiler
  [Mailer] [Mailgun] Fix expecting payload without tags or user variables
  [Validator] Update Spanish (es) translations
  Fix fetching data in `W3CReferenceTest` on AppVeyor
  Fix SQS visibility_timeout type
  [VarDumper] Fix serialization of stubs with null or uninitialized values
  • Loading branch information
nicolas-grekas committed Feb 15, 2024
2 parents d94a480 + 06dc5e5 commit 5367b8f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 9 deletions.
74 changes: 66 additions & 8 deletions Resources/views/Collector/mailer.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,24 @@
{% 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.getSubject() ?? '(No subject)' }}</td>
<td>{{ event.message.getTo()|map(addr => addr.toString())|join(', ')|default('(empty)') }}</td>
<td>
{% if event.message.subject is defined %}
{{ event.message.getSubject() ?? '(No subject)' }}
{% elseif event.message.headers.has('subject') %}
{{ event.message.headers.get('subject').bodyAsString()|default('(No subject)') }}
{% else %}
(No subject)
{% endif %}
</td>
<td>
{% if event.message.to is defined %}
{{ event.message.getTo()|map(addr => addr.toString())|join(', ')|default('(empty)') }}
{% elseif event.message.headers.has('to') %}
{{ event.message.headers.get('to').bodyAsString()|default('(empty)') }}
{% else %}
(empty)
{% endif %}
</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 @@ -323,18 +339,42 @@
<div class="tab-content">
<div class="card-block">
<p class="mailer-message-subject">
{{ message.getSubject() ?? '(No subject)' }}
{% if message.subject is defined %}
{{ message.getSubject() ?? '(No subject)' }}
{% elseif message.headers.has('subject') %}
{{ message.headers.get('subject').bodyAsString()|default('(No subject)') }}
{% else %}
(No subject)
{% endif %}
</p>
<div class="mailer-message-headers">
<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>
<p>
<strong>From:</strong>
{% if message.from is defined %}
{{ message.getFrom()|map(addr => addr.toString())|join(', ')|default('(empty)') }}
{% elseif message.headers.has('from') %}
{{ message.headers.get('from').bodyAsString()|default('(empty)') }}
{% else %}
(empty)
{% endif %}
</p>
<p>
<strong>To:</strong>
{% if message.to is defined %}
{{ message.getTo()|map(addr => addr.toString())|join(', ')|default('(empty)') }}
{% elseif message.headers.has('to') %}
{{ message.headers.get('to').bodyAsString()|default('(empty)') }}
{% else %}
(empty)
{% endif %}
</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>
</div>

{% if message.attachments %}
{% if message.attachments is defined and message.attachments %}
<div class="card-block">
{% set num_of_attachments = message.attachments|length %}
{% set total_attachments_size_in_bytes = message.attachments|reduce((total_size, attachment) => total_size + attachment.body|length, 0) %}
Expand Down Expand Up @@ -364,9 +404,10 @@
{% endif %}

<div class="card-block">
{% set textBody = message.textBody %}
{% set htmlBody = message.htmlBody %}
<div class="sf-tabs sf-tabs-sm">
{% if message.htmlBody is defined %}
{% set textBody = message.textBody %}
{% set htmlBody = message.htmlBody %}
<div class="tab {{ not textBody ? 'disabled' }} {{ textBody ? 'active' }}">
<h3 class="tab-title">Text content</h3>
<div class="tab-content">
Expand Down Expand Up @@ -414,6 +455,23 @@
{% endif %}
</div>
</div>
{% else %}
{% set body = message.body ? message.body.toString() : null %}
<div class="tab {{ not body ? 'disabled' }} {{ body ? 'active' }}">
<h3 class="tab-title">Content</h3>
<div class="tab-content">
{% if body %}
<pre class="mailer-email-body prewrap" style="max-height: 600px">
{{- body }}
</pre>
{% else %}
<div class="mailer-empty-email-body">
<p>The body is empty.</p>
</div>
{% endif %}
</div>
</div>
{% endif %}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"symfony/http-kernel": "^6.4|^7.0",
"symfony/routing": "^6.4|^7.0",
"symfony/twig-bundle": "^6.4|^7.0",
"twig/twig": "~3.8.0"
"twig/twig": "^3.0.4"
},
"require-dev": {
"symfony/browser-kit": "^6.4|^7.0",
Expand Down

0 comments on commit 5367b8f

Please sign in to comment.