Render a template publication
Render a template publication. View request and response details for this Samva email API endpoint.
Renders one immutable publication against the data you pass, formatted in the locale and timeZone you name as a send formats them, and returns the subject, preheader, HTML and plain text a send would produce. data is validated against the publication's input schema exactly as a send validates it; invalid input returns a validation error that names each failing field. Nothing is sent or stored. Unpublished workspace edits are never rendered: only a publication id renders.
apiKeyx-api-key<token>id*string^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$publicationId*string^tpub_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
data*The input to render with, validated against the publication's input schema.
locale?RenderLocalelength <= 64timeZone?RenderTimeZonelength <= 64TemplatePublicationRender
application/json- response
subject*stringpreheader?stringhtml*stringlength <= 2097152text*stringlength <= 2097152import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.templates.renderPublication({ "id": "example", "publicationId": "example", "data": {}});{ "subject": "string", "preheader": "string", "html": "string", "text": "string"}Related documentation
Rename a template family
Changes a template family's name and returns the updated family. Use this endpoint to rename a template family through the Samva email API.
Render a declared template workspace fixture
Renders one of the named inputs the template declares against the current effective workspace tree.