Preview an email template
/email-templates/{id}/actions/previewRenders the template as the platform would send it and returns { "data": { "html", "subject" } }. The body can try content, subject, a theme and branding without saving: anything left out comes from the template as it is stored. It only reads, sends no email and emits no webhook, so there is nothing to undo. Use PATCH /email-templates/{id} to save changes.
Path parameters
The template slug, such as user_welcome. It is the template's id. A leading underscore is accepted and ignored.
Headers
Makes a retry safe. Send a new UUID for each new request and reuse it only to retry that request; the first response is replayed for 24 hours.
Request body
application/json, optional
The content to render. Defaults to the content the template sends.
The subject to render. Defaults to the template's subject.
- One of:
The email theme to render with, for this preview only.
deliois the platform default, institutional is formal, boutique refined, family-office understated, heritage traditional, clean minimal and corporate structured. Defaults to the token organisation's theme: its own, its parent's, elsedelio.delio,institutional,boutique,family-office,heritage,clean,corporate Branding to render with in place of the organisation's own.
{
"content": "<p>Welcome, {{contactForename}}.</p>",
"theme": "corporate"
}Responses
The rendered email.
{
"data": {
"html": "<html>...rendered email...</html>",
"subject": "Welcome to the platform"
}
}Authorization failed. error.code is one of org_disabled,
ip_blocked, missing_scope, scope_disabled, user_disabled.
The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per
problem, or a code documented on the operation.
Examples
curl -X POST https://your-org-domain/kong/core/api/v2/email-templates/{id}/actions/preview\
-H "Authorization: Bearer $HELM_API_KEY"\
-H "Content-Type: application/json"\
-d '{
"content": "<p>Welcome, {{contactForename}}.</p>",
"theme": "corporate"
}'