mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-03-20 18:23:12 -04:00
When previewing a template on the send page, having the recipient appear as a placeholder should help reinforce the relationship between the columns in the CSV and the placeholders. Then, when previewing a message, having the template populated with the first recipient’s email address/phone number should reinforce that relationship again.
64 lines
1.6 KiB
HTML
64 lines
1.6 KiB
HTML
{% macro email_message(
|
|
subject,
|
|
body,
|
|
name=None,
|
|
edit_link=None,
|
|
from_name=None,
|
|
from_address=None,
|
|
recipient=None,
|
|
show_placeholder_for_recipient=False
|
|
) %}
|
|
{% if name %}
|
|
<h3 class="email-message-name">
|
|
{% if edit_link %}
|
|
<a href="{{ edit_link }}">{{ name }}</a>
|
|
{% else %}
|
|
{{ name }}
|
|
{% endif %}
|
|
</h3>
|
|
{% endif %}
|
|
<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">
|
|
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" data-module="expand-collapse" data-max-height="200">
|
|
<div class="email-message-body-wrapper">
|
|
{{ body|nl2br }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|