Grosend|Docs
Getting Started
  • Introduction
  • Quick Start
Sending
  • SMTP Relay
  • Authentication
API Reference
  • Overview
  • Send Email
  • Domains
  • Templates
  • API Keys
  • Webhooks
Analytics
  • Tracking
Docs
Getting Started
  • Introduction
  • Quick Start
Sending
  • SMTP Relay
  • Authentication
API Reference
  • Overview
  • Send Email
  • Domains
  • Templates
  • API Keys
  • Webhooks
Analytics
  • Tracking

Templates

Create reusable email templates with variable placeholders.

Create a template

Terminal
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

Terminal
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

Terminal
curl https://send.grosend.com/api/v1/templates \
  -H "Authorization: Bearer sv_live_..."

Delete a template

Terminal
curl -X DELETE https://send.grosend.com/api/v1/templates/{template-id} \
  -H "Authorization: Bearer sv_live_..."