2016-05-05 08:38:55 +01:00
|
|
|
{% macro email_message(
|
|
|
|
|
subject,
|
|
|
|
|
body,
|
|
|
|
|
name=None,
|
|
|
|
|
edit_link=None,
|
|
|
|
|
from_name=None,
|
|
|
|
|
from_address=None,
|
|
|
|
|
recipient=None,
|
|
|
|
|
show_placeholder_for_recipient=False
|
|
|
|
|
) %}
|
2016-01-13 16:27:54 +00:00
|
|
|
{% 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">
|
2016-02-23 14:58:49 +00:00
|
|
|
{% 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 %}
|
2016-05-05 08:38:55 +01:00
|
|
|
{% 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 %}
|
2016-02-23 14:58:49 +00:00
|
|
|
{% if subject %}
|
|
|
|
|
<tr class="email-message-meta">
|
|
|
|
|
<th>Subject</th>
|
|
|
|
|
<td>
|
|
|
|
|
{{ subject }}
|
|
|
|
|
</td>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2016-02-18 14:54:59 +00:00
|
|
|
{% endif %}
|
2016-04-12 20:58:30 +01:00
|
|
|
<div class="email-message-body" data-module="expand-collapse" data-max-height="200">
|
2016-04-12 16:21:41 +01:00
|
|
|
<div class="email-message-body-wrapper">
|
2016-02-08 16:36:53 +00:00
|
|
|
{{ body|nl2br }}
|
2016-04-11 15:16:41 +01:00
|
|
|
</div>
|
2016-01-13 16:27:54 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{% endmacro %}
|