Skip to content

fix(core): let extensions listen to MessageSending - #5217

Merged
imorland merged 1 commit into
2.xfrom
im/mail-sending-listeners
Oct 16, 2026
Merged

imorland merged 1 commit into
2.xfrom
im/mail-sending-listeners

Conversation

@imorland

Copy link
Copy Markdown
Member

Fixes: no issue. Found while building fof/mailtrap-mail.

Changes proposed in this pull request:
The mailer dispatches MessageSending with until(), and MutateEmail returned true, so no listener registered after it ran. That is every extension's: none could change an outgoing message, or stop one by returning false. MutateEmail now returns nothing. This has been the case since #4069.

Reviewers should focus on:

  • MutateEmail::handle() changes from bool to void. The class isn't marked @public.
  • fof/filter's tests already worked around this by listening to MessageSent.

Screenshot
N/A

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation. (No frontend changes.)
  • Frontend changes: tests are green (run yarn test in js/). (No frontend changes.)
  • Frontend changes: tests have been added, or are not appropriate here. (No frontend changes.)
  • Backend changes: tests are green (run composer test).
  • Backend changes: tests have been added, or are not appropriate here.
  • Where applicable, changes are suitable for all supported database drivers (MySQL, MariaDB, PostgreSQL, SQLite).
  • Core developer confirmed locally this works as intended.
  • The description above is written by me and describes what this pull request actually does.

@imorland imorland added this to the 2.0.2 milestone Oct 16, 2026
@imorland
imorland marked this pull request as ready for review October 16, 2026 16:01
@imorland
imorland requested a review from a team as a code owner October 16, 2026 16:01
@imorland
imorland merged commit 7ac99e4 into 2.x Oct 16, 2026
30 checks passed
@imorland
imorland deleted the im/mail-sending-listeners branch October 16, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant