- Issue created by @weseze
- 🇬🇧United Kingdom adamps
Thanks for the report. Sorry I believe it was caused by 📌 Change to the phases Active .
I took the code that alters "to" out of
LegacyMailerHelper::emailFromArray()
because this was too late and was causing wrong languages. It's tricky because whatever order I do things in seems to break some specific case😃. - 🇬🇧United Kingdom adamps
Potentially we can fix something like this:
- Remove the new
@trigger_error
in BaseEmailTrait::setAddress. - Put back the code removed from LegacyMailerHelper. NB if code alters the to address in hook_mail_alter (during the build phase) they should note that it won't affect the language (which is based on checking if the "to" address belongs to a user, and using that user's language) as it's too late.
- Keep the new code in LegacyEmailBuilder to set "to" during the init phase - this is a better time to set "to" in general because it can affect language.
- Remove the new
- Merge request !164Issue #3527050: hook_mail_alter() cannot alter email "to" header → (Merged) created by adamps
- 🇧🇪Belgium weseze
I tested the 1.6 + patch file based on "24ec304e - V1 backport".
This work as expected for us. Both in webform mails, and other mails.