rootmail

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.

GET/v1/templates
POST/v1/templates
GET/v1/templates/:id
PATCH/v1/templates/:id
DELETE/v1/templates/:id
template.ts
await mail.templates.create({
  slug: "welcome",
  subject: "Welcome to {{product}}, {{name}}!",
  html: "<h1>Hi {{name}}</h1><p>Get started at {{action_url}}.</p>",
});