All emails have the site email as the from address, not the store email

Created on 25 July 2022, over 2 years ago
Updated 17 September 2024, 4 months ago

Describe your bug or feature request.

I have a store set up with "Store email notifications are sent from this address" set to the email address I want. The address is correct.
But regardless, all emails are sent from the site email address which is different.
I have cleared caches several times.

If a bug, provide steps to reproduce it from a clean install.

This is a new install.
Create a store, add a "Store email notifications are sent from this address" email address.
Notifications do not come from this address.
Notifications come from the site email address.

💬 Support request
Status

Active

Version

2.30

Component

Store

Created by

🇦🇺Australia CBEEM

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand djroshi

    I think this may depend on which mailer you are using? In my case I am using Drupal Symfony Mailer ( https://www.drupal.org/project/symfony_mailer ). A quick debug of commerce_store_mail_alter() reveals that, in my case, $message['params']['from'] is not empty, so $message['from'] is never rewritten.

    From the docs for hook_mail_alter:

    'params': An array of optional parameters supplied by the caller of MailManagerInterface->mail() that is used to build the message before hook_mail_alter() is invoked.

    I'm not sure how necessary the empty($message['params']['from']) check is so not sure what the workaround might be...

Production build 0.71.5 2024