evalinkdocs

Write a template

Write your first template step by step: print a value, give it a fallback, shape it with a filter, add text only when a condition is true, and repeat text for a list.

Write a template in any field that accepts placeholders, for example the SMS Text of a Twilio Send SMS step with Default Text switched off, or the subject and text of a Send Email step. The template is filled in when the step runs.

Double braces print a value. Dots reach into it.

Alarm at {{ device.name }}: {{ alarm.alarmName }}

Output: Alarm at Shop Bahnhofstrasse: Burglary

Give an empty value a fallback

A value that isn't set prints nothing. default fills the gap:

Customer: {{ device.customerCompany | default('private') }}

Shape a value with a filter

A filter follows a pipe. Filters chain from left to right:

{{ device.name | upper }} – {{ alarm.timestamp | date('dd.MM.yyyy HH:mm') }}

Output: SHOP BAHNHOFSTRASSE – 04.04.2025 14:14. For all filters, see Filters and functions.

Join text

~ joins text and values into one:

{{ device.name ~ ' (' ~ alarmCode ~ ')' }}

Output: Shop Bahnhofstrasse (BA)

Add text only when a condition is true

{% if device.testMode %}TEST – no action needed.
{% endif %}Alarm {{ alarmCode }} at {{ device.name }}

With more cases, use elseif and else:

{% if alarmCode == 'FA' %}Fire alarm: call the fire brigade.
{% elseif alarmCode == 'BA' %}Burglary: send a guard.
{% else %}Check the alarm.
{% endif %}

Conditions can use ==, !=, <, >, and, or, not, contains, and tests such as is empty:

{% if alarm.alarmValue and not device.testMode %}Real alarm.{% endif %}

Repeat text for a list

{% for tag in device.tags %}#{{ tag }} {% else %}no tags{% endfor %}

Output: #vip #night . The else part is printed when the list is empty. Inside the loop, loop.index counts from 0, and loop.first and loop.last tell the first and last item:

{% for tag in device.tags %}{{ tag }}{% if not loop.last %}, {% endif %}{% endfor %}

Output: vip, night

Keep a value for later

{% set zone = alarmZone | default('unknown zone') %}
Alarm in {{ zone }}. Please check {{ zone }}.

Add a comment

A comment doesn't appear in the text:

{# Shown to the guard company #}
Alarm at {{ device.name }}

Layout

Line breaks and spaces stay exactly as you type them, including those around {% %} blocks. To avoid empty lines, put a block on the same line as the text around it, as in the examples above.

The text isn't HTML-escaped: < stays <.

Test a template

  1. Write the template.
  2. Run the workflow on a test alarm, or on a site in test mode.
  3. Open the step in the alarm's workflow and read its log: it shows what was sent, for example the subject and text of an email.

The workflow simulator (Test Workflow) can't run automated steps, so it doesn't show their text. If a value prints nothing, see When a template doesn't work.