- Issue created by @tobas1996
- last update
about 1 year ago 61 pass - @tobas1996 opened merge request.
- last update
about 1 year ago 61 pass - @tobas1996 opened merge request.
- Status changed to Postponed: needs info
about 1 year ago 5:30pm 25 October 2023 - 🇬🇧United Kingdom adamps
$headers['From'] is set in MailEntity::getHeaders()
I see no need for the extra lines you added. The setting is a from header, it doesn't say it will affect any other headers, often that would be incorrect.
Hi!
I am modifying that function MailEntity::getHeaders() , adding this :
+ $headers['Sender'] = $this->getFromAddress();
+ $headers['Return-Path'] = $this->getFromAddress();Maybe you mean that its redundant to pass again to $message['from'] at MailBuilder::buildNewsletterMail().
If we do not modify this (at least the MailEntity:getHeaders()), the sender is always the configuration system site email.
Hope it helps
- Status changed to Closed: works as designed
about 1 year ago 10:52am 26 October 2023 - 🇬🇧United Kingdom adamps
This is working as designed. If you wish to alter other fields you can write a hook to do it.
- Status changed to Active
about 1 year ago 6:27pm 9 November 2023 - 🇨🇦Canada yang_yi_cn
We have the same issue. I think if it's "by design" then the design is wrong.
Bascially whatever "FROM" you set in the Newsletter settings, it doesn't work, It always fallback to site default e-mail.
I'm not sure about "Return To" part, but from my reading / testing, the $headers['Sender'] is actually needed to get a proper devliery. Just setting "FROM" address will get ignored by most mail servers such as Outlook, Gmail etc. Maybe we should test if it's empty befor settings it?
$headers['Sender'] = empty($headers['Sender']) ? $this->getFromAddress() : $headers['Sender'];
- Status changed to Postponed
about 1 year ago 11:46am 21 November 2023 - 🇬🇧United Kingdom adamps
You can set the sender using "Basic site settings" /admin/config/system/site-information
I'm pretty sure the code isn't going to change in this module. Many others sites are very happy with the way it works now.
Yes, we can change the 'Basic site settings' but, maybe we don't want to send the newsletter simplenews emails with that email.
It should be the email from newsletter, not from the "Basic site settings".
Hope it helps you!