Visitar URL original
Ticket/17751 Add core.notification_method_messenger_modify_template_vars event by bonelifer · Pull Request #7099 · phpbb/phpbb · GitHub
Skip to content

Ticket/17751 Add core.notification_method_messenger_modify_template_vars event - #7099

Open
bonelifer wants to merge 1 commit into
phpbb:3.3.xfrom
bonelifer:ticket/17751
Open

bonelifer wants to merge 1 commit into
phpbb:3.3.xfrom
bonelifer:ticket/17751

Conversation

@bonelifer

@bonelifer bonelifer commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Checklist:

  • Correct branch: master for new features; 3.3.x for fixes
  • Tests pass
  • Code follows coding guidelines: master and 3.3.x
  • Commit follows commit message format

Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB-17751

Adds core.notification_method_messenger_modify_template_vars to messenger_base::notify_using_messenger(). It fires for each queued notification just before the template variables are assigned to the email, with notification and user (read-only) and template_vars (modifiable). A listener can add its own variables to a core notification email.

This is the companion to core.messenger_template_paths (#7054 for master, #7098 for 3.3): that event lets an extension supply its own copy of a core email template, and this one gives that copy new data to show.

The dispatcher comes from the global $phpbb_dispatcher, so the constructors of the email and jabber notification methods do not change.

The new tests/notification/notification_method_messenger_base_test.php sends one notification through the real messenger and checks that a variable added by a listener reaches the email template. Without the event the test fails.

The code around this spot differs on master, so this does not merge up cleanly. The master version is in #7100.


Investigated and written by Claude on behalf of William Jacoby (bonelifer).

…_vars

Add an event to messenger_base::notify_using_messenger(), fired for each
queued notification just before its template variables are assigned to
the email. A listener can add or change template_vars, for example to
show extra data in its own copy of a core notification email template
(see core.messenger_template_paths, PHPBB-17722 and PHPBB-17750).

The dispatcher is read from the global $phpbb_dispatcher, so the
constructors of the email and jabber notification methods stay the same.

PHPBB-17751
@github-actions

Copy link
Copy Markdown

The attempt to merge branch 3.3.x into master has completed after considering the changes in this PR.

  • Merge result: Conflict ❌

A separate PR will be needed to merge 3.3.x into master.

bonelifer added a commit to phpbbmodders/ban-hammer that referenced this pull request Oct 20, 2026
The request text for core.notification_method_messenger_modify_template_vars,
filed as PHPBB-17751 with core PRs phpbb/phpbb#7099 (3.3.x) and #7100
(master). It pairs with the email template override request already in
docs/events/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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