Templates
Store HTML once. Send with a slug and a data object. No more copying markup into every request.
How it works
- Edit a template in Dashboard → Templates (welcome, OTP, invoice, and more).
- Use
{{name}}placeholders in the subject or HTML. - POST
/api/sendwithtemplate+data.
Request
Send with a template
Starter slugs
| Slug | Variables |
|---|---|
| welcome | name, product |
| verify-email | name, link |
| password-reset | name, code |
| otp | name, code |
| invoice | name, amount, invoice_id, date |
| payment-successful | name, amount, product |
| payment-failed | name, amount, retry_url |
| subscription-expiring | name, plan, date |
| account-suspended | name, reason, support_url |
from — optional if you have one Gmail connected. Required if you have several.
Missing data — the API returns 400 listing the empty {{variables}}.
Custom HTML — omit template and send subject + html as before.