Skip to main content
A template is a subject plus an HTML and/or plain-text body with {{placeholders}}. Sending with templateId renders the current version with the variables you pass.

Placeholders

  • Names use letters, digits and underscores and start with a letter or underscore: {{first_name}}, {{ order_id }} (spaces inside the braces are fine).
  • Values may be strings, numbers or booleans.
  • In the HTML part values are HTML-escaped, so <script> from a user becomes harmless text. In the subject and text part they are inserted as-is.
  • {{unsubscribe_url}} is reserved: Sendbaze fills it in on marketing email.
  • Every placeholder the template uses must be supplied at send time. A missing one is a 422 validation_error with fields such as { "variables.eta": ["is required by the template"] }. Extra variables are ignored.

Send with a template

subject is optional with a template and overrides the template’s subject when given. html, text and react cannot be combined with templateId. Prefer components over placeholders? See React Email.

Versions

Every content change (subject, html or text) creates a new version; a rename does not. The message records the template id and the version it rendered, so editing a template never changes what an already-sent email said. The dashboard shows the history with a Restore button, which makes an old version current again as a new version. GET /v1/templates/{id}/versions returns them with full content.

Manage templates

Templates in the dashboard lists your templates, creates new ones and opens an editor with:
  • subject, HTML and plain-text fields with the placeholders it finds
  • a live preview with sample values you can change
  • version history with restore
  • Send a preview to yourself from any verified domain, which goes through the normal send path and counts as one email

Preview a render

POST /v1/templates/{id}/render returns what a send would produce. Placeholders you leave out come back under missing and stay in the output, so it doubles as a linter for your variables.

React Email and other renderers

If you build email with React Email, MJML or a templating engine of your own, render to HTML in your app and pass html (and text) to the send request. Sendbaze templates are for teams that want non-developers to edit copy in the dashboard.