Skip to main content

render_email_template

Renders an email template by reading a file from the local filesystem and applying the provided context using a template engine.

def render_email_template(
template_name: string,
context: dict[str, Any]
) - > string

Renders a pre-built email template from the local filesystem using the provided context data.

Parameters

NameTypeDescription
template_namestringThe filename of the pre-built template located in the email-templates/build directory.
contextdict[str, Any]A dictionary of key-value pairs used to populate dynamic placeholders within the template.

Returns

TypeDescription
stringThe fully rendered HTML content of the email, ready for transmission.