Skip to main content

Email template reference

To write a template for an Email (template) alert, see Email alerts.

Variables you can use​

A template can use every field of the Performance Results webhook payload as a variable. For example, {{ result_class }} is the result class, {{ http_code }} is the HTTP status code, and {{ result_url }} is the link to the result in the portal. Reach into a nested field with a dot, as in {{ call_meta.name }} for the name of the Monitor. The context field is a dictionary of extra details about the result. The default body loops over it.

For example, this subject line names the Monitor, the HTTP code, and the node that made the call:

[{{ result_class }}] {{ call_meta.name }}: HTTP {{ http_code }} from {{ location_id }}

Default templates​

The default subject line is [{{result_class}}]: <application name>: {{ call_meta.name }}, where the portal fills in the application name.

The default body is:

{{ result }}: HTTP {{ http_code }} {{ http_reason }}
Latency: {{ response_time }} ms
Size: {{ response_size }} bytes

Variables:
{% for key, value in context|dictsort -%}
- {{ key }}: {% if value is mapping %}...{% else %}{{ value }}{% endif %}
{% endfor -%}

Result: {{ result_url }}