RimbraDocs

Templates

Write an email once and send it with different names, amounts and links each time.

Create a template

  1. 1Open Emails → Templates and choose New template.
  2. 2Give it a name, a subject and a body in HTML or plain text.
  3. 3Wrap the parts that change in double braces, like {{name}} or {{amount}}.
  4. 4Fill in the preview values to check how it looks, then save.
  5. 5Copy the template ID from the template page.

Send it

Send this body to the same send endpoint. Every variable in the subject or body must have a value, or the request is rejected with 422 and nothing is sent.

json
{
  "from": "receipts@yourcompany.com",
  "to": "ada@example.com",
  "template_id": "tpl_…",
  "variables": {
    "name": "Ada",
    "amount": "₦45,000"
  }
}

Good to know

  • Variable names can use letters, numbers, dots, dashes and underscores.
  • Values are escaped in HTML templates, so user input can’t inject markup.
  • Editing a template keeps its ID. Duplicate makes a new one.
  • Deleting a template makes requests that use its ID fail.