MailcrateDocs
Email templates

Render a template preview

POST
/public/email-template/{identifier}/render-preview

Renders the template to HTML without sending it. Pass data to fill its variables, and contactId (an id or external identifier) to render with that contact's properties.

Requires the email-template:write scope.

Authorization

ApiKey
headerAuthorization<token>

Api-Key mc_... — a workspace API key.

Path Parameters

identifier*string

Request Body

application/json
  1. body
contactId?string

Contact id or external identifier to render as.

data?

Values for the template's variables.

Response Body

application/json
  1. response
html*string

The rendered HTML.

Example Request
curl -X POST 'https://api.mailcrate.io/public/email-template/string/render-preview' \  -H 'Authorization: Api-Key <api_key>' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "html": "string"}