Merge Tags
Merge tags are placeholders in your template that get replaced with recipient-specific data at send time. They use double curly braces.Basic Substitution
Default Values
Always provide defaults for personalization fields. An email that reads “Hello ,” because the name field is missing looks broken.HTML Escaping
By default, merge tags are HTML-escaped to prevent cross-site scripting. If you need to render trusted HTML content, use triple curly braces:Conditional Content
Show different content to different recipients based on their attributes, plan level, activity, or any other data you pass.Basic Conditionals
Multi-Branch Conditionals
Use{{elseif}} for more than two branches:
Practical Use Cases for Conditionals
Dynamic Loops
Use{{each}} to iterate over arrays of data — order items, activity logs, recommendations, or any list.
Order Items
Combining Loops with Conditionals
Per-Recipient Personalization at Scale
When sending to multiple recipients in a single API call, pass individual substitution data for each recipient:Personalization Strategy
What to Personalize
Not everything needs personalization. Focus on elements that make the email feel relevant and useful.What Not to Personalize
Testing Personalized Templates
Preview with Sample Data
Before sending, test your template with different substitution data to verify all branches render correctly.Pay special attention to empty states. What does your template look like when
items is an empty array? When name is missing? When a conditional branch has no matching case? Every possible state should render cleanly.Common Mistakes
Over-personalizing subject lines
Over-personalizing subject lines
Using “Hey !” in every subject line has diminishing returns. Recipients learn to ignore it, and some find it off-putting. Save name personalization for the email body and keep subject lines focused on the content.
Not testing all conditional branches
Not testing all conditional branches
If you have 4 plan tiers, you need to test all 4 renderings plus the
else fallback. A broken conditional in a branch you didn’t test will surprise you in production.Using unescaped output with user data
Using unescaped output with user data
Triple curly braces (
{{{ }}}) skip HTML escaping. If user-submitted data contains HTML tags or scripts, it renders raw in the email. Only use triple braces with system-generated, trusted content.Sending the same test data every time
Sending the same test data every time
Testing always with
name: 'Test User' and plan: 'pro' misses edge cases. Vary your test data to cover missing fields, empty arrays, long strings, and unusual characters.Related Topics
Template Language
Full reference for merge tags, conditionals, loops, and filters
Templates
Build and manage email templates with the Topol editor
Batch Sending
Send to multiple recipients with per-recipient data
Template Versions
Manage and publish template versions