Template variables
Flow-authored copy can include {{variable}} placeholders that are filled in at send time with data about the visitor, the conversation, the triggering message, and Flow runtime variables. This works in plain messages and in the text fields of rich messages.
Syntax
Hi {{client.name}}, thanks for reaching out about {{message.text}}.Available paths:
| Placeholder | Resolves to |
|---|---|
{{client.name}} | Visitor name ({{client.nickname}} is an alias) |
{{client.email}} | Visitor email |
{{client.traits.plan}} | A nested path into the visitor's custom attributes (traits) |
{{chat.id}}, {{chat.country}} | Whitelisted conversation fields |
{{message.text}} | The triggering visitor message |
{{variables.xxx}} | A Flow runtime variable |
{{variables.form.email}} | Dotted keys resolve literal-first, so form values like form.email stay reachable |
{{form.email}}, {{button_text}} | Unprefixed shorthand — names that don't match a top-level context key fall back to the Flow variable bag |
Resolution rules
- Unresolved or non-scalar values become an empty string. A raw
{{...}}is never leaked to the visitor. - Values are inserted as plain text. No HTML escaping is applied at interpolation time (the widget renderer handles escaping); markdown characters in a value pass through verbatim.
- Booleans render as
1(true) or an empty string (false).
Which fields are interpolated
In rich message payloads, only human-visible text keys are interpolated: title, subtitle, description, text, markdown, label, submit_label, placeholder, caption, plus the form-prefill keys default and value. Structural keys (url, id, value of a button, step_id, action types) are never touched.
Localization
Any human-visible text field can be a {lang: text} map instead of a plain string. Lane.Chat resolves it to the visitor's language, defaulting to English:
{
"title": {
"en": "Choose a plan",
"es": "Elige un plan",
"de": "Wähle einen Tarif"
}
}Language keys are BCP-47 tags (en, es, pt-BR, zh-TW, ...). Localization is resolved first, then {{variable}} interpolation runs on the chosen language.