- 🇳🇿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...