Merge tags
The templating syntax Senlo templates use, and where each value comes from.
{
"id": 12,
"to": "ada@example.com",
"data": { "name": "Ada", "order": { "number": "A-1049", "total": "42.00" } }
}Hi {{name}}, order {{order.number}} is confirmed. Total: {{order.total}}.A merge tag is a path in double braces. It is replaced with the value at that path in the data the email is sent with.
Syntax
{{name}}: the value ofname.{{order.total}}: dots walk into nested objects.- Spaces inside the braces are ignored:
{{ name }}is the same tag.
There are no filters, helpers or default values. A conditional row or block covers "show this only if the value is set"; a loop covers lists.
Where values come from
Triggered emails (POST /api/triggered) see the request's data:
| Tag | Value |
|---|---|
{{name}}, {{order.total}} | Fields of data |
{{custom.name}} | The same fields, written explicitly |
{{contact.email}} | The recipient address (to) |
{{contact.name}} | data.name: every field of data is also available under contact. |
{{unsubscribe_url}} | The recipient's unsubscribe page |
Automation emails see the contact: its metadata in place of data, and {{contact.email}}. A contact created with metadata: { "plan": "pro" } renders {{plan}} and {{contact.plan}} as pro. The contact's name and locale fields are not tags; put a value in metadata to use it in a template.
Loops add the loop's alias: a row looping over items with alias item renders {{item.title}} for each element.
{{project.name}} (or {{workspace.name}}) is the workspace name in the subject line.
Missing values
A tag whose value is missing, null, or an object or array, is left in the email as written, braces included. Test with the editor's Mock Data before sending.
Escaping
Values are HTML-escaped where they are inserted into the email body: <, >, &, quotes, { and ; become entities, so data from a request can never inject markup, another merge tag, or a CSS declaration. In the subject line values are inserted as plain text.
A value used as a link (href="{{url}}") is checked after substitution: javascript:, data: and similar schemes are removed.
The unsubscribe link
{{unsubscribe_url}} (also written {{unsubscribeUrl}}) is the page where the recipient unsubscribes. Use it as the href of an unsubscribe link in your footer. Every email also carries a List-Unsubscribe header for the mail client's own button. See Tracking and unsubscribe.