Overview
Variables let you personalize emails with dynamic content. Instead of hardcoding names, dates, or links, use variables that get replaced with real values at send time.
Variable Syntax
Variables use double curly braces with an optional default:
{{variableName|defaultValue}}
Examples
Hello {{firstName|there}}!
Your order #{{orderNumber}} has shipped.
Track your package: {{trackingUrl}}
With and Without Defaults
With Default
{{firstName|Friend}}
If firstName isn’t provided, shows “Friend”.
Without Default
{{firstName}}
If firstName isn’t provided, shows empty string.
Empty Default
{{middleName|}}
Explicitly shows nothing if not provided.
Where to Use Variables
Variables work in:
- Body text -
Hello {{name}}! - Subject lines -
Your order {{orderNumber}} is ready - Button text -
View {{itemName}} - Links -
https://example.com/track/{{trackingId}} - Alt text -
Photo of {{productName}}
Variables Panel
The editor automatically extracts variables from your template:
- As you type
{{variableName}}, it appears in the variables panel - Set default values in the panel
- Preview with sample data
Providing Values via API
When calling the API, pass variables in the request:
{
"templateId": "tmpl_abc123",
"variables": {
"firstName": "Alice",
"orderNumber": "12345",
"trackingUrl": "https://example.com/track/abc"
},
"_to": "alice@example.com"
}
Reserved Fields
Fields starting with _ are reserved for email delivery:
| Field | Purpose |
|---|---|
_to | Recipient email address |
_subject | Override subject line |
_replyTo | Reply-to address |
_cc | CC recipients |
_bcc | BCC recipients |
These aren’t template variables—they configure email delivery.
Variable Naming
Good Names
firstNameorderNumbercompanyNameresetLink
Avoid
first name(no spaces)1stName(don’t start with numbers)_reserved(underscore prefix is reserved)
Nested Content
For conditional content, use defaults strategically:
{{couponSection|}}
Then provide HTML for couponSection when you want it shown, or omit it to show nothing.
Common Patterns
Personalized Greeting
Hi {{firstName|there}},
Order Confirmation
Order #{{orderNumber}}
Shipping to: {{shippingAddress}}
Estimated delivery: {{deliveryDate|3-5 business days}}
Password Reset
Click here to reset your password:
{{resetLink}}
This link expires in {{expiry|24 hours}}.
Welcome Email
Welcome to {{companyName}}, {{firstName}}!
Here's what you can do next:
{{gettingStartedSteps}}
Testing Variables
- Add variables to your template
- Open the preview
- Enter test values in the variables panel
- See the rendered result
Debugging
Variable not replaced?
- Check spelling matches exactly (case-sensitive)
- Ensure curly braces are correct:
{{not{ - Verify you’re passing the variable in the API call
Seeing raw {{variable}}?
- The variable has no default and wasn’t provided
- Add a default:
{{variable|default}}