dev: Adopt mjml 5 for email template generation#7979
Merged
Conversation
MJML v5 disabled mj-include by default. Enable includes in generate.sh (--config.allowIncludes true) so the base template's trusted repo-local partials resolve, and append a trailing newline that v5 no longer emits. Regenerate base.html.tmpl and the golden files; the output is functionally identical to v4 (whitespace and one attribute-order change only).
3 tasks
nicholaspcr
marked this pull request as ready for review
July 22, 2026 16:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MJML v5 disabled
mj-includeby default for security, which is what broke the generated-template CI check:generate.shdidn't pass--config.allowIncludes true, so the_attributes/_header/_footerpartials were dropped andbase.html.tmplregenerated with MJML's default Ubuntu config.This PR keeps the v5 bump and makes generation v5-compatible instead of reverting it.
Changes
generate.sh: pass--config.allowIncludes true; append the trailing newline v5 no longer emitsbase.html.tmpl: regenerated under v5 — functionally identical to v4 (6 blank lines removed inside<style>blocks + one attribute-order change on the article<div>; header/footer/body/fonts/styles all unchanged)testdata/*.body.golden.html(13 files): regenerated viago test -write-goldento reflect the base-template changeDEVELOPMENT.md: document why includes are enabledpackage.json/yarn.lockchanges — v3.36 already pinsmjml@^5.4.0Test plan
go generate ./pkg/email/templatesreproducesbase.html.tmplwith no diffgo test ./pkg/email/templatespasses (golden-file comparison)Notes for reviewers
The rendered HTML is equivalent to v4 — no email-client-visible change is expected.
allowIncludesis safe here because the included.mjmlfiles are trusted and committed to this repo.