Merge token reference
A merge token drops one contact’s own data into a subject line or a message body. ColdMerge uses its own small syntax, not Handlebars, Mustache, or Liquid. There are no loops, no conditions, and no property paths.
Syntax
Section titled “Syntax”{{fieldName}}{{fieldName | fallback text}}{{and}}mark the token.- The text before the first
|is the field name. - The text after the first
|is the fallback, used when the field has no value. - Whitespace just inside the braces is trimmed, so
{{ firstName }}and{{firstName}}are the same token.
Field names
Section titled “Field names”| Rule | Detail |
|---|---|
| Match is exact | Field names match exactly as stored, including case and separators. {{firstName}} and {{firstname}} are different tokens. |
| One built-in | {{email}} is the only built-in token. It always renders the contact’s address. |
| Built-in wins | A stored custom field named email is legal, but {{email}} renders the address, not that field. |
| Everything else is yours | Any column header from an import becomes a usable token. firstName and lastName are offered by convention on every contact. |
| Nothing else is addressable | Internal values such as ids and timestamps have no token. |
Field names cannot contain |, {, }, or a line break. A column with one of
those in its header is refused at the import mapping step and never becomes a
token.
Fallbacks
Section titled “Fallbacks”A fallback is the text used when the field is absent, empty, or only whitespace. All three count as missing.
Hi {{firstName | there}},If the contact has no first name, the recipient sees Hi there,.
Two details worth knowing:
- The first
|separates the name from the fallback, so the fallback itself may contain a|. In{{firstName | a | b}}the fallback isa | b. - An empty fallback is still a fallback.
{{company |}}renders nothing there, and that counts as a deliberate decision.
There is no way to write a default once for a whole campaign. A fallback belongs to one token.
The missing-field guard
Section titled “The missing-field guard”A token with no value and no fallback blocks the send to that person. The check runs everywhere a send happens, the campaign send, a follow-up send and a preview send, but only the campaign send and the follow-up send are stopped by it.
Adding a fallback is the fix that produces good mail. Your other options at launch time (skip those contacts, or send anyway with the tokens empty) are described on Launch a campaign.
A preview send is the one exception to blocking. It never refuses outright, it just reports which tokens rendered empty. See What a preview send really does.
Malformed tokens
Section titled “Malformed tokens”A token ColdMerge cannot read is left in the message exactly as you typed it, as literal text. It does not throw an error and it does not disappear. Four things make a token malformed:
| Written | Result |
|---|---|
{{firstName |
No closing }}, so it is literal text. |
{{first then a line break then Name}} |
A line break inside the braces, so it is literal text. |
{{ {{firstName}} |
A brace inside the braces. There is no nesting. The leading {{ is literal text and {{firstName}} is a real token. |
{{}} or {{ | there}} |
An empty field name, so it is literal text. |
There is no escape sequence for a literal {{. Writing about the syntax in a
message is safe, because malformed tokens ship as they are written.
Escaping and formats
Section titled “Escaping and formats”How a value is inserted depends on the format the campaign sends in.
- In a plain text message, values are inserted raw. A contact at
Smith & Sonsarrives asSmith & Sons. - In an HTML message, values are escaped, because contact data is untrusted. Fallback text is escaped the same way a real value would be.
- A subject line is always treated as text, never as markup.
You do not choose the format. It follows from what you wrote. See Write your campaign.
Live data, not a snapshot
Section titled “Live data, not a snapshot”Merge tokens render from the contact as they are at the moment the message is actually sent, not as they were when you launched. Fixing somebody’s company name on day one does reach them if their send happens on day three.
Follow-ups behave differently. A contact’s merge data is frozen when they are enrolled in the sequence. See How follow-up sequences work.