Skip to content

Upgrade email templates to MJML 5 #84

Description

@andrewyager

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions