Templates

Content blocks

Templates

Let your users drop one of their own saved emails, PDFs or documents into a design. They add the block, pick a template from a list that comes from your organization, and its content appears in the email.

How a user uses it#

  1. Add Templates from the content panel (it is only there when your app provides templates).
  2. Click the block and choose a template in the Template list. Templates are grouped as Emails, PDFs and Documents.
  3. The template's content fills the block. Update from template copies it again after the template changes; Remove empties the block.

The content is a copy taken when it is chosen, so a sent email never changes behind the user's back. Like a Custom HTML block, it is cleaned (scripts and event handlers dropped, its own <style> inlined) and its merge tags resolve per recipient. A block nobody has filled exports nothing, and the quality check flags it.

Providing the templates#

Pass savedTemplates in the editor config. load returns the signed-in organization's templates; give each one its html, or leave it out and answer loadContent when one is chosen (better for a long list).

tsxeditor.tsx
<EmailEditor
  config={{
    savedTemplates: {
      // [{ id, title, kind: "email" | "pdf" | "document", updated_at?, html? }]
      load: () => fetch("/api/templates").then((r) => r.json()),
      // only for templates that came without html
      loadContent: (id) => fetch("/api/templates/" + id + "/html").then((r) => r.json()) // { html, updated_at? }
    }
  }}
/>
PropertyControlsDefault
id / titleWhat the list shows and what the block remembers,
kindGroups the list: email, pdf, document (any other word works and becomes its own group),
updated_atShown on the block as "saved Sep 28, 2026",
htmlThe template's content. Omit it to use loadContent,
Return only the templates the signed-in user may use. The editor shows what you give it. If the list cannot be loaded, or a template cannot be opened, the block says so and keeps what it had.

Block values#

PropertyControlsDefault
template_id / title / kindWhich template was chosen,
htmlA snapshot of the template's content, copied when it was chosen,
source_updated_atWhen that template was last changed,
background_color / padding / border_radiusThe block's surfacetransparent / 0 / 0

The MCP server and Cloud API know it as saved-template (see get_block_schema). A model cannot know a user's templates, so it should leave choosing to the user; see File for the other block that brings content in from outside.