Sendzovo templates let you store reusable email content
and send it by template ID or alias. Templates support
dynamic variables through template_model
and can optionally be associated with a sending domain,
Message Stream and Layout.
Send with a template
Pass the template ID or alias in template.
When a template is used, its rendered subject, HTML and
text content are used for the message.
curl -X POST "https://api.sendzovo.com/v1/messages" \
-H "Authorization: Bearer YOUR_SENDING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "hello@example.com",
"to": [
{
"email": "customer@example.net",
"name": "Customer"
}
],
"template": "welcome",
"template_model": {
"name": "Customer",
"company": "Example App"
}
}'
A template alias provides a stable, readable value
such as welcome or
password-reset. You may also supply the
template ID.
Template variables
Supply dynamic values in the
template_model object. Sendzovo renders
those values into the template before the message is
queued.
{
"template": "welcome",
"template_model": {
"name": "Aisha",
"company": "Example App"
}
}
Templates and Message Streams
A template can be associated with a Message Stream. When that template is used, its assigned stream is used for the message. If the template is tied to a domain, it can only be used with that sending domain.
Templates and Layouts
A template can also use a reusable Layout. Sendzovo
renders the template variables first and inserts the
rendered template content into the Layout's
{{content}} placeholder.
Templates API
Template API operations use the same Sending API key authentication as the Send Email API.
| Method | Endpoint | Description |
|---|---|---|
GET |
/templates |
List templates. |
POST |
/templates |
Create a template. |
POST |
/templates/validate |
Render and validate a template using a template model. |
GET |
/templates/{template} |
Retrieve a template. |
PUT |
/templates/{template} |
Update a template. |
DELETE |
/templates/{template} |
Delete a template. |
Validate and render a template
/templates/validate
curl -X POST "https://api.sendzovo.com/v1/templates/validate" \
-H "Authorization: Bearer YOUR_SENDING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"template": "welcome",
"template_model": {
"name": "Customer",
"company": "Example App"
}
}'
The validation endpoint accepts a template ID or alias and returns the rendered subject, HTML and text content.
Create a free Sendzovo account, verify your domain and send your first email in minutes.