Skip to content

Templates

Templates hold a reusable subject, html, and text body with {{variable}} placeholders, so your application code sends data, not markup.

Terminal window
curl https://api.sendsignal.dev/templates \
-H "Authorization: Bearer ss_..." -H "Content-Type: application/json" \
-d '{
"name": "Welcome email",
"alias": "welcome-email",
"subject": "Welcome, {{user.name}}!",
"html": "<p>Hi {{user.name}}, thanks for joining.</p>"
}'

Templates follow a draft → published flow: edit freely with PATCH /templates/{id}, then POST /templates/{id}/publish when it’s ready. Sends referencing an unpublished template are rejected, except in test mode, so you can iterate before launch.

The alias is a stable slug (lowercase letters, digits, -/_, max 64 chars, unique per team) and is the recommended way to reference templates from code, surviving duplication and re-creation.

Reference the template by alias (or template_id) and pass variables in data:

{
"from": "Acme <hi@acme.com>",
"to": "user@example.com",
"template": "welcome-email",
"data": { "user": { "name": "Sam" } }
}

Fields you pass explicitly (subject, html, text) override the template’s versions of those fields, and are themselves rendered with the same variables.

  • GET /templates / GET /templates/{id}: list and inspect.
  • GET /templates/{id}/preview: rendered preview of the stored content.
  • POST /templates/{id}/duplicate: copy, e.g. to draft the next revision.
  • DELETE /templates/{id}: remove.