{# Reusable, email-client-safe building blocks. Import WITH CONTEXT so the macros can read `brand` and `palette` from the render context: {% from 'email/partials/_macros.html' import status_pill, button, metrics, chip with context %} #} {# A severity pill: tinted lozenge + leading dot, all solid colors. #} {% macro status_pill(label=None) -%}
●  {{ label or palette.label }}
{%- endmacro %} {# Bulletproof CTA button. #} {% macro button(url, label) -%}
{{ label }}
{%- endmacro %} {# Inline monospace value chip — for hostnames, sizes, ids, durations. #} {% macro chip(value) -%} {{ value }} {%- endmacro %} {# A facts table. rows = list of {label, value, mono?}. #} {% macro metrics(rows) -%} {% for row in rows %} {% endfor %}
{{ row.label }} {% if row.mono %}{{ chip(row.value) }}{% else %}{{ row.value }}{% endif %}
{%- endmacro %} {# One alert in a multi-alert (monitoring) email — left-bordered, colored by its own severity. ``severity_styles`` comes from the render context. #} {% macro alert_card(alert) -%} {% set st = severity_styles.get(alert.severity, severity_styles['info']) %}
{{ st.label }}{% if alert.type %} · {{ alert.type }}{% endif %}
{{ alert.message }}
{% if 'value' in alert or 'threshold' in alert %}
{% if 'value' in alert %}Current: {{ alert.value }}{% endif %} {% if 'value' in alert and 'threshold' in alert %}  ·  {% endif %} {% if 'threshold' in alert %}Threshold: {{ alert.threshold }}{% endif %}
{% endif %}
{%- endmacro %} {# Horizontal rule that respects dark mode. #} {% macro divider() -%}
 
{%- endmacro %}