Campaign messages can include user-based context variables. You may use variables to quote the targeted user full name, their country, or even their company (if it's known).

How to use variables?

Variables are added to your messages using the following format: {{ variable_name }}. A recognized variable block will be expanded into the corresponding variable value (ie. {{ name.first }} can become John, or be empty if user name is unknown).

If you need to add a fallback value if there is no value to be replaced, use the following format: {{ variable_name | "Fallback text value" }}.

When you enter a variable in the campaign Markdown editor, you can check it is recognized by Crisp by toggling to message Preview. A valid (recognized) variable will appear green, while an invalid (non-recognized) variable will appear red.

Which variables are available?

You can use the following user variables in your messages:

Full name: {{ name.full }} or {{ name.full | "Fallback Full Name" }}
First name: {{ name.first }} or {{ name.first | "Fallback First Name" }}
Last name: {{ name.last }} or {{ name.last | "Fallback Last Name" }}
Email: {{ email }} or {{ email | "Fallback Email" }}
Country: {{ country }} or {{ country | "Fallback Country" }}
City: {{ city }} or {{ city | "Fallback City" }}
Website: {{ website }} or {{ website | "Fallback Website" }}
Company name: {{ company.name }} or {{ company.name | "Fallback Company Name" }}

Notice: if a value is unknown for a given user, the variable will be replaced with empty text.

Usage example

You can find below a sample message using variables:

Hello {{ name.first }}, how are you doing?

Wow, you are living in {{ city | "Unknown city" }}, {{ country | "Unknown country" }}!

Cheers.
Was this article helpful?
Thank you!