Description
MJML 5.0.0 (released 2026-04-16) changes how includes are compiled. With the current templates, the header include (templates/emails/mjml/_header.mjml) is dropped from the compiled output, and with it the {{ brand_primary_color }} and {{ logo_url }} template variables. Emails render unbranded and the TestEmailTemplateRendering tests fail.
Until this is resolved the Dockerfile pins mjml@4.18.0 (see the uv migration PR).
Use Case
Stay on a supported MJML release line while keeping branded transactional emails (S4.14).
Proposed Approach
- Reproduce with
npx -p mjml@5 mjml src/templates/emails/mjml/account_approved.mjml and compare with mjml@4.18.0 output (header section missing, ~half the size).
- Check the MJML 5 migration notes for
mj-include path resolution and mj-raw handling; adjust the include paths or template structure.
- Confirm Django template tags inside
<mj-raw> survive compilation.
- Bump the pin in the Dockerfile and
scripts/build-emails.sh; run pytest src/accounts/tests/test_auth.py -k EmailTemplate against a freshly built image (the dev bind mount hides compiled templates, so test in the CI image).
Spec Consideration
Fits within current spec (S4.14 HTML Email Templates). No spec change expected unless the base template structure has to change.
Description
MJML 5.0.0 (released 2026-04-16) changes how includes are compiled. With the current templates, the header include (
templates/emails/mjml/_header.mjml) is dropped from the compiled output, and with it the{{ brand_primary_color }}and{{ logo_url }}template variables. Emails render unbranded and theTestEmailTemplateRenderingtests fail.Until this is resolved the Dockerfile pins
mjml@4.18.0(see the uv migration PR).Use Case
Stay on a supported MJML release line while keeping branded transactional emails (S4.14).
Proposed Approach
npx -p mjml@5 mjml src/templates/emails/mjml/account_approved.mjmland compare withmjml@4.18.0output (header section missing, ~half the size).mj-includepath resolution andmj-rawhandling; adjust the include paths or template structure.<mj-raw>survive compilation.scripts/build-emails.sh; runpytest src/accounts/tests/test_auth.py -k EmailTemplateagainst a freshly built image (the dev bind mount hides compiled templates, so test in the CI image).Spec Consideration
Fits within current spec (S4.14 HTML Email Templates). No spec change expected unless the base template structure has to change.