← Back to Docs

Email Templates

Create and use dynamic email templates

Template Variables

Use double curly braces to insert dynamic content into your emails.

Example Template

<h1>Hello !</h1>
<p>Welcome to .</p>
<p>Your account was created on .</p>
<a href="">Go to Dashboard</a>

Sending with Variables

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"
  }
}

Conditional Content

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 %}

Loops

Iterate over arrays in your templates:

<ul>
{% for item in order_items %}
  <li>{{item.name}} - ${{item.price}}</li>
{% endfor %}
</ul>