Overview
Templates let you define reusable email layouts with{{variable}} placeholders. When sending, pass the template ID and variable values — Sendi renders the final email for you.
How It Works
- Create a template in the dashboard or via API with HTML, text, and subject containing
{{variables}} - Send an email with
template_idandtemplate_variablesinstead of raw HTML/text - Sendi replaces all
{{variable}}placeholders with your values and sends
Variable Syntax
Use double curly braces for variables:Sending with a Template
Overriding Template Fields
If you passsubject, html, or text alongside a template_id, the explicit values take precedence over the template’s values.
Variable Auto-Detection
When you create or update a template, Sendi automatically detects all{{variable}} names and stores them in the variables field. This makes it easy to see which variables a template expects.
Dashboard Editor
The dashboard includes a visual template editor with:- Starter templates — Welcome, Password Reset, Invoice, or start blank
- Live preview — See rendered HTML with sample data
- Variable insertion — Click to insert common variables at cursor position
- HTML / Text / Preview tabs — Switch between code and rendered view