Skip to content

Send transactional email for user domain using a saved template

POST
/api/domains/{domain}/message/template

Send an email for a domain owned by the authenticated user using a stored template. Supports variable replacement using {{variable}} syntax in both subject and content. Template must belong to the authenticated domain. Supports attachments with the same processing options as non-template message endpoint.

domain
required
string
Example
example.com

Domain name that must be owned by the authenticated user

object
template_guid
required

UUID of the template to use

string format: uuid
Example
550e8400-e29b-41d4-a716-446655440000
to
required
One of:
string format: email
Example
from

Sender email address. Must belong to the authenticated domain. Defaults to noreply@{domain} if not provided.

string format: email
Example
from_name

Optional sender display name. If not provided, will use the email address only.

string
Example
Company Name
variables
One of:

Single set of variables for all recipients

object
Example
{
"name": "John Doe",
"product": "Premium Widget"
}
headers
One of:
object
Example
{
"X-Campaign-ID": "welcome-series"
}
reply_to

Reply-to email address. Must share the same top-level domain as the ‘from’ address for security compliance.

string format: email
Example
attachments
One of:

Single file attachment

string format: binary
attachment_options

JSON string with attachment processing options. Watermark text is limited to 50 characters.

string
Example
{"compress": true, "password": "secret123", "watermark": {"enabled": true, "text": "CONFIDENTIAL"}}

Template-based email jobs dispatched

object
success
boolean
Example
true
message
string
Example
Template-based email jobs dispatched for 2 recipients in 1 job(s)
template_guid
string
Example
550e8400-e29b-41d4-a716-446655440000
template_name
string
Example
Welcome Email
X-RateLimit-Limit
integer

Maximum requests per minute

X-RateLimit-Remaining
integer

Remaining requests in current window

Unauthorized - Invalid or missing authentication credentials

object
success
boolean
message
string
Example
Unauthorized

Not Found - Domain or template not found

object
success
boolean
message
string
Example
Domain not found or you do not own this domain.

Validation Error - Invalid input data

object
success
boolean
message
string
Example
Validation failed.
errors

Field-specific validation errors

object

Too Many Requests - Rate limit exceeded. Retry after the specified time.

object
success
boolean
message
string
Example
Too many attempts. Please try again later.
Retry-After
integer

Seconds until rate limit resets

X-RateLimit-Limit
integer

Maximum requests per minute

X-RateLimit-Remaining
integer

Remaining requests in current window

Server Error - Unexpected error occurred

object
success
boolean
message
string
Example
An error occurred while sending the template message. Please try again.