Project

General

Profile

Sub-Task #194

Updated by Bricklou 18 days ago

MJML source is compiled to HTML via mrml, a pure-Rust MJML→HTML renderer that only handles static markup (no variable/conditional syntax of its own). 

 Dynamic value injection (recipient name, verification link, etc.) is done via Tera, a Jinja2-style templating engine, layered on top of the compiled HTML. Tera is chosen over Askama specifically because it loads templates at runtime instead of compiling them into the binary, which enables the filesystem override below without a rebuild. 

 - Built-in default templates are embedded in the binary. 
 - Optional filesystem override: a TEMPLATE_DIR environment variable (consistent with the project's env-var-only config convention) points to a folder; if a matching template file exists there, it is used instead of the embedded default. No database involved. 
 - Delivery of the rendered output is handled separately (see #195).

Back