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

Command icon 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

adamps created an issue. See original summary.

adamps’s picture

Issue summary: View changes

  • adamps committed c37525c5 on 2.x
    fix: #3591264 Incorrect order of EmailProcessor execution
    
adamps’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.