Sending
Templates
Reusable, versioned email designs you send by slug.
Author templates in the dashboard's visual studio (no code) or via the API. Reference one by slug when sending and pass variables — they're merged with Handlebars. Saved-contact details (name, first_name, custom fields) fill in automatically for every recipient; explicit variables override them.
GET
/v1/templatesPOST
/v1/templatesGET
/v1/templates/:idPATCH
/v1/templates/:idDELETE
/v1/templates/:idtemplate.ts
await mail.templates.create({
slug: "welcome",
subject: "Welcome to {{product}}, {{name}}!",
html: "<h1>Hi {{name}}</h1><p>Get started at {{action_url}}.</p>",
});