emails

Send an email using a template

Send a transactional email by rendering a saved template with optional merge variables. The template must have rendered HTML (saved at least once in the editor). The sender domain must be verified in the project workspace; verified sender domains are shared by every Developer Email API project in that workspace.

post/v3/emails/template

Request

  • Base URL: https://api.unlayer.com
  • URL: https://api.unlayer.com/v3/emails/template
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Headers

idempotency-keystring

Unique key for idempotent sends (max 255 characters). Duplicate requests within 24 hours return the cached response.

Request body

fromstring required

Sender email address or "Name <email>" format. Domain must be verified.

tostring[] required

Exactly one recipient. Each request creates one independently tracked delivery.

templateIdstring required

Template ID to use for the email body

subjectstring

Email subject line. Supports {{variable}} merge syntax. Defaults to template name if omitted.

variablesobject

Merge variables to substitute in the template and subject. Use {{key}} syntax in your template.

textstring

Plain text version of the email. Supports {{variable}} merge syntax.

replyTostring email

Reply-To email address

tagsobject

Key-value tags for categorizing the email (e.g. {"campaign": "welcome"}). Max 10 tags. Keys (1-64 chars) and values (up to 256 chars) may only contain letters, numbers, underscores, and hyphens (the Amazon SES message-tag character set).

headersobject

Custom email headers. Up to 9 printable-ASCII X-* headers are allowed. Header names may contain up to 126 characters and each name plus value may contain up to 996 characters.

Response

Email accepted and queued for delivery

Changes

No recorded changes to this operation across all 2 revisions of this API.