mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-23 11:51:05 -05:00
This problem was masked because the email message component was also replacing newlines with `<br>`s. Implements: - [ ] https://github.com/alphagov/notifications-utils/pull/60
61 lines
1.6 KiB
HTML
61 lines
1.6 KiB
HTML
{% macro email_message(
|
|
subject,
|
|
body,
|
|
from_name=None,
|
|
from_address=None,
|
|
recipient=None,
|
|
id=None,
|
|
show_placeholder_for_recipient=False,
|
|
show_id=False,
|
|
expanded=False
|
|
) %}
|
|
<div class="email-message">
|
|
{% if from_name or subject %}
|
|
<table class="email-message-meta">
|
|
<tbody>
|
|
{% if from_name and from_address %}
|
|
<tr>
|
|
<th>From</th>
|
|
<td>
|
|
{{ from_name }} <{{ from_address }}>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if recipient is not none %}
|
|
<tr>
|
|
<th>To</th>
|
|
<td>
|
|
{% if show_placeholder_for_recipient %}
|
|
<span class="placeholder-no-brackets">
|
|
email address
|
|
</span>
|
|
{% else %}
|
|
{{ recipient }}
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if subject %}
|
|
<tr class="email-message-meta">
|
|
<th>Subject</th>
|
|
<td>
|
|
{{ subject }}
|
|
</td>
|
|
</div>
|
|
{% endif %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
<div class="email-message-body" {% if not expanded %}data-module="expand-collapse" data-max-height="200"{% endif %}>
|
|
{% if not expanded %}
|
|
<div class="email-message-body-wrapper">
|
|
{% endif %}
|
|
{{ body }}
|
|
{% if not expanded %}
|
|
</div>
|
|
<div class='toggle' tabindex='0'>...<span class='visually-hidden'>show full email</span></div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|