---
title: "Render Email"
method: POST
path: "/v1/email-templates/render"
tags: ["email-templates"]
---

# Render Email

`POST /v1/email-templates/render`

## Request

- Base URL: `https://api.elaan.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.elaan.io/v1/email-templates/render`
- Auth: none declared

Resolve the brand override (else tenant default) and render it with the
event variables merged over the brand's values — the 'what would we send'
preview.

## Headers

- `authorization` string, nullable

## Request body

- RenderRequest: Resolve + render one channel's template for a notification type under a brand. The brand key is always required. `variables` is the event payload, rendered at the top level with the brand under `brand.*` — the same shape a send uses. A preview has no recipient, so `{{ contact.* }}` renders empty here.
  - `notification_type_key` string, required
  - `branding_key` string, required
  - `variables` object: Values for the template's `{{ slot }}` markers — the same shape `POST /v1/notifications` takes, so a preview can be built from the payload you would really send. Any JSON: strings, numbers, nested objects, and lists a template repeats over with `{% for %}`.
  - `language` string, nullable

## Response `200`

Successful Response

- RenderedEmailResponse
  - `template_id` string, required
  - `branding_key` string, nullable, required
  - `language` string, nullable, required
  - `subject` string, required
  - `body` string, required

## Other responses

- `422`: The branding doesn't exist, no template resolves, or the event variables + branding values don't cover every slot

---

[API](https://skmtc.dev/elaan/apis/elaan-api.md) · [All operations](https://skmtc.dev/elaan/apis/elaan-api/llms.txt) · [OpenAPI document](https://skmtc.dev/elaan/apis/elaan-api/revisions/c96a7e6399aa?raw)
