Skip to content

Run regTplFuncs on MJML campaign body#3131

Merged
knadh merged 1 commit into
knadh:mjmlfrom
dfabulich:mjml-regtplfuncs
Jul 8, 2026
Merged

Run regTplFuncs on MJML campaign body#3131
knadh merged 1 commit into
knadh:mjmlfrom
dfabulich:mjml-regtplfuncs

Conversation

@dfabulich

Copy link
Copy Markdown
Contributor

This fixes the issue Hodor raised in #2643 (review)

  • [P1] Apply template-func normalization to MJML body before mjml.Render (models/campaigns.go:171-188)
    • In CompileTemplate() the MJML path substitutes c.Body into the base and runs mjml.Render() before the campaign body ever goes through regTplFuncs rewriting (and the content sub-template is later set to ""). This means shorthand template helper calls inside the campaign body (eg {{ TrackLink "..." }}, {{ TrackView }} etc.) won't be rewritten to include dot context and can fail at render/send time even though non-MJML bodies get this normalization.

@dfabulich dfabulich changed the title Run regTplFuncs on MJML campain body Run regTplFuncs on MJML campaign body Jul 7, 2026
@knadh knadh merged commit 566f1dd into knadh:mjml Jul 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants