Using template variables
Learn what variables are and how they help personalize email and push templates
Template variables allow you to personalize content by inserting dynamic values like a user’s name or unsubscribe link.
What are template variables?
Template variables are placeholders you can use inside email or push templates to automatically insert personalized content.
For example, instead of writing a generic message like:
Hi there!
You can use a variable like:
Hi {{customer.fullname}}
!
When the message is sent, the variable will be replaced with the actual data of each recipient, such as “Hi John Doe!”
Why use variables?
Variables help you:
- Personalize your messages at scale
- Make emails and push notifications feel more human and relevant
- Increase engagement by showing context-aware content (like names, product info, or dates)
Where can you use variables?
Variables can be used in:
- Email templates (subject, header, body, footer)
- Push templates (title and body)
Masivo replaces the variables at the time of sending, using the actual customer or event data.
Common variable types
There are different variable categories available, depending on your use case:
customer
: Info about the recipient (e.g.{{customer.fullname}}
,{{customer.email}}
)global
: General values like unsubscribe links (e.g.{{global.unsubscribe}}
)event
: Data related to events or transactions (e.g.{{event.type}}
)
You don’t need to memorize them — the template editor will show you which variables are available depending on the context.
What happens if a variable is missing?
If a variable doesn’t have a value (for example, if a customer’s name is missing), the system might:
- Leave the variable blank
- Show a default fallback if defined
- Or throw an exception
It’s a good practice to make sure your data is complete or provide safe defaults when needed.
You can use preview mode in the editor to test how your message will look with real data.
If you want to see an example of how a variable is used inside an email template, check the section on How to configure the unsubscribe link.
Summary
Template variables allow you to build personalized and dynamic messages without writing custom content for each user. Use them to improve engagement, build trust, and make your messages feel more relevant and human.