Render an email template preview

posthttps://api.expiryedge.com/v1/emailTemplatePreview
any role (admin, editor or viewer)60/minAny method
Request
curl -X POST 'https://api.expiryedge.com/v1/emailTemplatePreview' \
  -H "Authorization: Bearer $EXPIRYEDGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "subject": "Reminder: {{expiry.name}} {{expiry.status}}",
  "body_html": "<p>{{expiry.name}} {{expiry.status}}.</p>"
}'
Response
{
  "subject": "Reminder: Acme Insurance Policy expires in 14 days",
  "html": "<p>Acme Insurance Policy expires in 14 days.</p>",
  "text": "Acme Insurance Policy expires in 14 days."
}

Renders an unsaved subject and body against sample data, or against context when supplied (max 64 KB). Nothing is saved or sent.

Body parameters

application/json
  • subjectstring
  • body_htmlstring
    At most ~900 KB.
  • contextobject
    Render context (same shape as sample from emailTemplateVariables).

Returns

200
The rendered email.
  • subjectstring
  • htmlstring
  • textstring
    Plain-text version derived from the HTML.

Errors

401
Missing, expired or invalid bearer token.
413
The template or context is too large to preview.
429
Too many requests for this endpoint from your IP. Wait Retry-After seconds.
500
Unexpected server error. Retry later; quote requestId to support.