Skip to main content

Module template

Module template 

Source
Expand description

Product-neutral mail template registration and rendering helpers.

Products still own template codes, default subject/body content, runtime configuration keys, payload types, URLs, and localization. This module only provides the shared mechanics around a registered template catalog: variable metadata, placeholder substitution, HTML escaping, and text fallback generation.

Structs§

MailTemplateCatalog
Runtime-composed template registry built from product and subsystem registrations.
MailTemplateCatalogBuilder
Builder used by products to assemble a mail template catalog from multiple subsystems.
MailTemplateDefinition
Registered metadata for one product mail template.
MailTemplateRegistry
A product-owned template registry.
RenderedMail
Rendered mail bodies produced from a template and placeholder values.
TemplatePlaceholderSet
Placeholder values for a render pass.
TemplateVariableGroup
Variable metadata for one registered template.
TemplateVariableItem
Variable metadata exposed to product admin UIs.
TemplateVariableSpec
One placeholder accepted by a template.

Enums§

MailTemplateRegistryError
Validation error returned when a template registry has ambiguous registrations.

Functions§

escape_html
Escapes text for insertion into HTML templates.
html_to_text
Converts simple HTML email content into a plain-text fallback.
render_placeholders
Replaces {{key}} placeholders with provided values.
render_template
Renders a subject and HTML template with placeholder values and derives text fallback.

Type Aliases§

MailTemplateRegistrar
Function exported by a product subsystem to register its mail templates.