Problem/Motivation
The expected behaviour is that the mailer class will build the email, then adjusters/hooks can alter it. The default weight for adjusters/hooks is EmailInterface::DEFAULT_WEIGHT = 500. The default weight for mailer classes is intended to be ComponentMailerBase::DEFAULT_WEIGHT = 300. Unfortunately this constant is defined but not actually used. Therefore the mailers and adjusters/hooks all run with the same weight, and are executed in an arbitrary order.
Steps to reproduce
Write a hook to override a mailer OR Use an adjuster to override a mailer. Maybe it has no effect.
Proposed resolution
Use the intended default weight.
There is a possibility that some site is relying on the wrong behaviour to get the result that they prefer. Perhaps they have a mailer policy setting that is incorrect/outdated, and currently this policy gets ignored, leading to the correct end result. I don't see anything we can do about this, other than to warn about it in the release note.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork symfony_mailer-3591264
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
adamps commentedComment #5
adamps commented