Skip to content

fix(analytics): register AnalyticsExtension so newsletters render (#543) - #584

Merged
Neophytis merged 1 commit into
mainfrom
fix/543-register-analytics-twig-extension
Oct 10, 2026
Merged

Neophytis merged 1 commit into
mainfrom
fix/543-register-analytics-twig-extension

Conversation

@Neophytis

Copy link
Copy Markdown
Contributor

Target branch: main. Prod bug since 3.8.x (#543, 2026-10-02): newsletters cannot be rendered.

#543 added the utm_links filter in src/Twig/AnalyticsExtension.php and uses it in templates/emails/newsletter.html.twig. src/Twig is excluded from autowiring in services.yaml, and every other extension there is registered by hand; this one was not. On prod:

$ bin/console lint:twig templates/emails/newsletter.html.twig
ERROR in templates/emails/newsletter.html.twig (line 3)
>> Unknown "utm_links" filter.

So send:massmail fails on the newsletter template. Transactional mails use other templates and are not affected.

Fix: register the class with the twig.extension tag, like the two other extensions in the same file. It has no constructor arguments.

Checked: on the route C branch (#582) the same registration makes debug:twig list utm_links and lint:twig pass for the newsletter template. To re-check on stage after merge: bin/console --env=prod lint:twig templates/emails/newsletter.html.twig.

Ship before the next newsletter goes out.

#543 added the utm_links filter in src/Twig/AnalyticsExtension.php and uses
it in templates/emails/newsletter.html.twig, but src/Twig is excluded from
autowiring and the class was not listed in services.yaml. On prod (3.8.4)
'lint:twig templates/emails/newsletter.html.twig' fails with
'Unknown "utm_links" filter', so sending a newsletter fails.
@Neophytis
Neophytis merged commit 53959fe into main Oct 10, 2026
13 checks passed
@Neophytis
Neophytis deleted the fix/543-register-analytics-twig-extension branch October 10, 2026 08:50
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.

1 participant