Skip to main content
A template holds the subject, HTML and text of an email. Your code sends its slug and the data; your team edits the content in the dashboard. Emails only change when someone publishes a new version.
With template, leave out html and text: they come from the template. subject and from are optional and replace the template’s when you send them. Attachments, tags, headers and idempotency keys work as usual.

Create a template

In the dashboard, open Templates and click New template. Start from a ready-made design (verification code, welcome, password reset, receipt, invoice, invitation, sign-in alert) or from your own HTML. You can also create one with the API:
Pass "starter": "otp" instead of html to start from a ready-made design. Starters: otp, welcome, password-reset, receipt, invoice, invitation, sign-in-alert.

Slugs

The slug is what your code sends: lowercase letters, digits and hyphens, 3 to 64 characters, unique in your team. Without one, PulseSend makes it from the name. When you rename a slug, the old one keeps working as an alias, so code already deployed doesn’t break. You can also use the template ID (tpl_…) anywhere a slug is accepted.

Drafts and versions

You always edit a draft. Nothing can be sent with a template until its first version is published, and emails keep using the published version while you edit. Publishing (in the dashboard, or POST /templates/{slug}/publish) turns the draft into the next version, v1, v2 and so on, and every email switches to it right away. To keep a call on a known version, pin it:
The last 50 versions are kept. Restoring an old one copies it into the draft: publish to make it live again.

Syntax

Templates use Mustache. Subject, HTML and text all accept it. Partials, blocks, pragmas and delimiter changes are not supported. A template that doesn’t parse is refused when you save it, with template_syntax_error and the line. Inside {{#items}}, names refer to the current item, so a receipt can list its lines:

Variables

PulseSend finds the variables in the subject, HTML and text. For each one, choose in the editor (or with variables in the API):
  • Required: the send fails with 422 template_variable_missing if data doesn’t have it, so nobody gets “Hello ,”.
  • A default value: used when data doesn’t have it.
  • An example: used only for the preview and test sends.
New variables are required until you say otherwise.

Team brand

Set your logo, color and postal address once in Settings › Team. They are always available as {{brand.name}}, {{brand.logo_url}}, {{brand.color}}, {{brand.on_color}} (black or white, whichever reads on your color) and {{brand.address}}. You never send them in data.

Preview and test

POST /templates/{slug}/render returns the subject, HTML and text a send would produce, without sending anything. It renders the draft, using examples for missing variables; pass "version": 3 to render a published version with the same checks as a real send. In the dashboard, Send a test sends the draft with its examples to a member of your team. It counts as a live email.

Plain text

Without a text version, PulseSend writes one from the HTML: headings and paragraphs on their own lines, links as label (url). Write your own in the Text tab or in text to replace it.

Limits

Scopes: templates:read (list, read, render, versions) and templates:write (create, edit, publish, delete). New keys get both.