Templates
Create reusable email templates with variable placeholders.
Create a template
curl -X POST https://send.grosend.com/api/v1/templates \
-H "Authorization: Bearer sv_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome Email",
"subject": "Welcome {{name}}!",
"html": "<h1>Welcome {{name}}</h1><p>Thanks for joining {{company}}.</p>"
}'
Use a template in an email
curl -X POST https://send.grosend.com/api/v1/emails \
-H "Authorization: Bearer sv_live_..." \
-H "Content-Type: application/json" \
-d '{
"from": "hello@yourdomain.com",
"to": ["user@example.com"],
"templateId": "template-uuid",
"variables": {
"name": "Alice",
"company": "Acme Inc"
}
}'
Variables
Use {{variable}} syntax in subject and HTML body. Pass values via the variables field.
All template variables are HTML-escaped by default. Use {{{variable}}} for raw HTML output (use carefully).
List templates
curl https://send.grosend.com/api/v1/templates \
-H "Authorization: Bearer sv_live_..."
Delete a template
curl -X DELETE https://send.grosend.com/api/v1/templates/{template-id} \
-H "Authorization: Bearer sv_live_..."