Render template
POST/api/v1/templates/{key}/render
The template's latest published version with the data, exactly as it is sent – for the preview in Qrona.
The data is checked against the template's data contract as when a message is sent. Nothing is sent and nothing is kept.
Scope
templates:renderPreview messages – the person behind the key must be all members.
Path parameters
keystringrequired- The template's key, the same as its data contract's.
Body
JSON, Content-Type: application/json. Unknown fields return 422.
dataobject<optional>required- The message's data, ready to show (amounts formatted, dates written out). Checked against the template's data contract.
categorystring- The class the message is to have (as when it is sent). Without: service.
servicemarketing toobject- A recipient to show it for. Without: an example name.
to.emailstringrequired- The recipient's address.at most 254 characters
to.namestring | null- The recipient's name. Fills {{first_name}} and {{last_name}} in the template.at most 200 characters
Retrying a request
Feel free to send the Idempotency-Key header (e.g. a UUID). If the same request is sent again with the same key within 24 hours, the first response is returned, without anything being done twice. Batch and idempotency
Response
200 The rendered template.
templatestringrequiredtemplate_versionintegerrequired- The version that was rendered: the latest published one, which a message would be made from now.
subjectstringrequired- The subject line, filled in.
htmlstringrequired- The message as HTML, exactly as it is sent (the links to the web version and to unsubscribe lead nowhere in a preview).
textstringrequired- The plain-text version.
warningsarray<string>required- What should be looked at, e.g. a link without an address.
Errors
- 400
- bad_request
- 404
- not_found
- 429
- rate_limited