
{% macro mail_content(center=False) -%}
  <tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
    <td class="content-wrap" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 20px;" valign="top"{% if center %} align="center"{% endif %}>
      <table width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
        {{ caller() }}
      </table>
    </td>
  </tr>
{%- endmacro %}


{% macro mail_block(center=False) -%}
  <tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
    <td class="content-block" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top"{% if center %} align="center"{% endif %}>
      {{ caller() }}
    </td>
  </tr>
{%- endmacro %}


{% macro mail_signature(author) -%}
  {% call mail_block() %}&mdash; {{ author }}{% endcall %}
{%- endmacro %}


{% macro mail_action_btn(label, url) -%}
  {% call mail_block() %}
    <a href="{{ url }}" class="btn-primary" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background: #348eda; margin: 0; padding: 0; border-color: #348eda; border-style: solid; border-width: 10px 20px;">{{ label }}</a>
  {% endcall %}
{%- endmacro %}


{% macro mail_alert(label="good") -%}
  <tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
    <td class="alert alert-{{ label }}" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 16px; vertical-align: top; color: #fff; font-weight: 500; text-align: center; border-radius: 3px 3px 0 0; background: #{% if label == 'good' %}68b90f{% elif label == 'warning' %}ff9f00{% else %}d0021b{% endif %}; margin: 0; padding: 20px;" align="center" valign="top">
      {{ caller() }}
    </td>
  </tr>
{%- endmacro %}


{% macro mail_link(url, label=None, color="#348eda") -%}
  <a href="{{ url }}" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 12px; color: {{ color }}; text-decoration: underline; margin: 0; padding: 0;">
    {% if label %}{{ label }}{% else %}{{ caller() }}{% endif %}
  </a>
{%- endmacro %}