mailvina
DocsTemplates ▾

Guides

Templates

Templates hold a subject and HTML with variables. Use {{{name}}} for raw output, {{name}} for HTML-escaped output, and {{{name|there}}} for a fallback.

curl -X POST 'https://api.mailvina.com/templates' \
  -H 'Authorization: Bearer mv_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Welcome",
  "alias": "welcome-email",
  "subject": "Welcome, {{{name|friend}}}!",
  "html": "<h1>Hi {{{name|there}}}</h1>"
}'

Send with a template by passing its ID or alias:

{
  "from": "Acme <[email protected]>",
  "to": "[email protected]",
  "template": { "id": "welcome-email", "variables": { "name": "Ada" } }
}