Skip to main content
POST
Render Template HTML
Render a template to the exact email-safe HTML that would be sent. Use this to show a visual preview inside your own dashboard or email builder without duplicating Sequenzy’s rendering logic. The render applies everything the send path applies: your email theme and font, company branding and footer, localization, block visibility conditions, product recommendation blocks, and merge tags.
This endpoint is read-only. It requires the templates:read scope and never sends or modifies anything. It uses POST only so personalization input can travel in a request body.

Request

string
required
Template ID. A transactional email’s ID or slug also works, and renders its underlying template without the unsubscribe footer.
string
Personalize as this stored subscriber. Use this or subscriber, not both. Because the rendered HTML then carries that subscriber’s details, this field also requires the subscribers:read scope.
object
Personalize as an ad-hoc contact that does not need to exist in your account. Accepts email (required), firstName, lastName, and customAttributes. Use this or subscriberId, not both.
object
Extra merge variables layered over the contact’s attributes.
string
Force a localization locale instead of deriving it from the contact.
boolean
default:"false"
Apply your company’s auto-UTM link decoration, as a real send would. Defaults to false so the preview shows your own clean URLs.

Checking merge tags

An email never shows a raw {{TAG}} to a recipient, so a tag that does not exist and a tag that is simply blank for this contact both render as an empty string. unresolvedMergeTags tells them apart:
  • "reason": "unknown" - nothing provides that name, so it will be empty for every recipient. Usually a typo, or a tag carried over from another platform.
  • "reason": "no_value" - the name is recognized but has no value for this contact.
A name is only called unknown when the render had a source to check it against. Without the contact’s attributes nothing is checkable at all - a bare {{plan}} reads the same attribute map as {{subscriber.plan}} - so pass a stored subscriberId, or an inline subscriber that includes customAttributes. Beyond that, {{event.*}} needs sample event properties in variables, since a real send fills those from the enrolling event, and {{recommendedProducts.*}} needs a stored subscriberId the catalog has something to recommend for. Without those, the tags come back as no_value rather than being reported as typos. An optional attribute that this contact happens not to have set is kept out of unknown by checking the names other contacts in the account carry, which is subscriber data: that check needs the subscribers:read scope, so a key without it may report such a name as unknown. {{discount.*}} is never checkable here: a template has no sequence position, so it is always reported as no_value. Rendering a transactional email is a special case. Its tags are filled from the variables you pass on each send, and those names carry no prefix marking them, so {{RESET_URL}} in a password-reset template is indistinguishable from a misspelling. Unless you pass variables here too, nothing in a transactional render is called unknown. An empty array means every tag in the email resolved.

What is not in the HTML

Per-send click-redirect wrapping, the open tracking pixel, and unsubscribe click tracking are applied at send time against a real email send record, so they are never present in the returned HTML. The tracking flag controls auto-UTM decoration only.

Responses