Use double curly braces to insert dynamic content into your emails.
<h1>Hello !</h1>
<p>Welcome to .</p>
<p>Your account was created on .</p>
<a href="">Go to Dashboard</a>
POST /v1/emails/send
{
"to": "john@example.com",
"subject": "Welcome !",
"template_id": "tmpl_welcome_001",
"variables": {
"first_name": "John",
"company_name": "Acme Inc",
"created_at": "December 22, 2024",
"dashboard_url": "https://app.acme.com/dashboard"
}
}
Show or hide content based on conditions:
{% if is_premium %}
<p>Thank you for being a premium member!</p>
{% else %}
<p>Upgrade to premium for more features.</p>
{% endif %}
Iterate over arrays in your templates:
<ul>
{% for item in order_items %}
<li>{{item.name}} - ${{item.price}}</li>
{% endfor %}
</ul>