Transactional Emails
Send Transactional Email
POST /v1/emails/sendSend a transactional email to one or more recipients.
Use Cases:
- Order confirmation emails
- Password reset emails
- Account verification emails
- Payment receipts
- Shipping notifications
- Welcome emails
- Any one-off automated email
Content Modes:
You can send emails in two ways:
- Raw HTML Mode: Provide
html(required) and optionallytextcontent directly - Template Mode: Reference a published template by its
uniqueSlugidentifier
These modes are mutually exclusive - provide either template or html, not both.
Template-Based Sending:
{
"from": "noreply@yourdomain.com",
"to": "customer@example.com",
"template": {
"id": "order_confirmation",
"variables": {
"firstName": "John",
"orderNumber": "12345",
"total": 99.99
}
}
}
When using templates:
- The template must be published (have a
publishedVersionId) - Variables are substituted using
{{variableName}}syntax - Missing variables are replaced with empty strings
- Subject and previewText can be overridden by providing them in the request
- The
textfield cannot be used with templates (it comes from the template)
Behavior:
- Email is queued and sent asynchronously
- Returns immediately with the email send ID
- Delivery status is tracked via webhooks
- Supports HTML and plain text content
- Plain text is auto-generated from HTML if not provided
- Supports attachments (up to 25 files, 25MB total)
- Custom metadata can be attached for tracking
Required Scope: smtp:send
Rate Limits:
- 100 emails per minute per API key
- Maximum 10MB HTML content
- Maximum 25 attachments (total 25MB)
Delivery Tracking:
- Use the returned email ID to track delivery status
- Configure webhooks to receive delivery notifications
- Events: delivered, bounced, complained, opened, clicked
Best Practices:
- Always include a plain text version for accessibility
- Keep HTML under 100KB for best deliverability
- Use verified sending domains only
- Include unsubscribe links for marketing content
Bodyrequired
fromstring<email>requiredSender email address (must be from a verified sending domain)
toanyrequiredRecipient email address(es) - single email or array of emails
replyToobjectCustom reply-to address (optional)
subjectstringEmail subject line (required when not using template, optional override when using template)
previewTextstringPreview text shown in email clients (optional, overrides template value if provided)
htmlstringHTML email body content (required when not using template)
textstringPlain text email body content (auto-generated from HTML if not provided, cannot be used with template)
templateobjectTemplate-based sending: provide template identifier and variables instead of html/text
attachmentsobject[]Email attachments (max 25 files, 25MB total)
metadataobjectCustom metadata for tracking (key-value pairs)
Response
objectstringrequiredObject type identifier
idstringrequiredUnique email send ID for tracking