Skip to content

renderer-mail-html

A renderer-foundation plugin that handles RenderRequest { kind: "mail" } and returns { subject, html, text, previewText? } suitable for sending via channel-email. The mail template (kind: "mail", document HTML, subject in meta) resolves through template-resolver’s DB fallback, its body is compiled to Handlebars by template-resolver and rendered with escaping, then placed into an MJML layout (kind: "mail-layout", slug default unless meta.layoutSlug says otherwise, an in-code structured layout with the tenant branding logo and accent color as last resort) that mjml() compiles to email-safe table HTML, with html-to-text producing the plain-text alternative. An optional footer resolver adds the platform imprint, privacy link and footer text below every structured layout, an optional brandSuffix resolver adds a word after the tenant name in the brand row of the in-code layout, and an optional siteUrl resolver supplies the site link of the card when the tenant branding has no site URL (without either, the link is left out). The brand row and data-resource="logo" images use the branding logo upload, or the branding logo https address when no file is uploaded. Mail meta headerChip, tone and footerNote add a chip beside the brand, the tone of the top line and chip, and a note above the site and unsubscribe links of the card. readMailChrome hands the same brand row and footer, resolved for one locale, to pages a recipient opens from a mail, such as the unsubscribe page. Seed an editable system layout with seedSystemMailLayout(db). Requires renderer-foundation + template-resolver.

What this feature needs to run (Requires).

flowchart TB
  n_renderer_mail_html["renderer-mail-html"]
  subgraph how_reqs["Requires"]
    n_renderer_foundation["renderer-foundation"]
    n_template_resolver["template-resolver"]
  end
  n_renderer_foundation --> n_renderer_mail_html
  n_template_resolver --> n_renderer_mail_html
  • Registers extension: renderer → mail-html