Closed tstamplis closed 5 years ago
I can confirm I am also seeing this issue. In order to work around the problem I have had to force the FROM header from the php.ini file.
sendmail_path= "/usr/sbin/sendmail -t -i -f enter@emailaddresshere.com"
Have the same issue: Ticket #14945
@SamB-GB So need to add the mine mail in the php.ini ?thank you
Hi @SambB-GB, I guess this is a misunderstanding. gwharton closed my issue "Store Email Adresses are not used anymore" because it is the same as this one. It does not mean, that there will be no soultion for it.
Correct gwharton ? BR Chequille
@chequille yes. The solution to both will be tracked under this issue. Having it tracked in two places will just lead to confusion.
Yes thats correct @rigu12
This is the commit that introduced this bug.
https://github.com/magento/magento2/commit/f2bfdd941c0c8c6c7c745156d1ce206e38c76820
Broken during fix applied for #11740
If you manually revert the changes in files according to that commit, you can get back to pre bug status.
app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
@RomaKis What was this commit trying to achieve?
Facing the same issue here in Magento 2.2.4. We have one website with 2 stores (Thai + English).
I had the same issue. after 2.2.3 >2.2.4 update. We have 4 websites with 2 stores each.
I did as gwharton suggested, I used the 2 files from 2,2,3 and it's working correctly now from what I can tell.
Thank you!
so 2.2.4 recover 2.2.3 this file?? @ozziel app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
You will have to recover them from their source folders: NOTE: if you can't tell your restore function where to restore files and it restores them to the original path BE SURE TO BACKUP ORIGINALS ALREADY THERE FROM 2.2.4 before restoring vendor/magento/module-sales/Model/Order/Email/SenderBuilder.php vendor/magento/framework/Mail/Template/TransportBuilder.php
and then create the above folders and put them there app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
Keep in mind that this overrides magento default functions so if and when the corrections are made, you will need to remove these to use default functions again.
Hope this helps.
I did as ozziel suggested (thanks for pointing to the vendor folder where my files were) and it fixed the problem.
Correct. The fix by @ozziel worked for me too. I hope there will come up a patch for this issue.
Have you tried to switch to any SMTP module if it would fix the issue until Magento patch will be available?
I have installed the module "Mageplaza_Smtp" and i tried "MagePal_GmailSmtpApp". Both gave me a blank from-sender. But that is obvious, because the problem is much further in the procedure. See answer from ozziel, the paths.
Guys I made quick extension and forced it to be used only on Magento 2.2.4 version assume that bugfix will be in the next release. I tested and it works on my websites. I hope it can help you as well: https://github.com/sashas777/bug-from-email
You can install it using composer and then remove when will be new Magento 2 release. If you will forget to remove then you will have version compatibility error with any other Magento 2 release.
The problem is they created a new class
Magento\Framework\Mail\Template\TransportBuilderByStore
and correctly added FROM header to member "message" of the class.
But the "message" member of TransportBuilderByStore never used. Instead, the member "message" of the class TransportBuilder is getting used(which never updated with FROM email).
Moral of the story, they added FROM email correctly but never used it while sending the email.
The tiny extension by @sashas777 does the required job as of now.
@sashas777 Good Job!! Just one suggestion, it would be better if you can rename the folder 'Plugin' to 'Rewrite' or something else. Because the fix is done using class rewrite instead of the plugin. The folder name "Plugin" misleads ;-)
@sashas777 I did the required change and created a pull request. Please merge it if it makes sense :smiley:
@ravinders-121
Thanks - I updated the package.
@sashas777 fixed it for me too - weird how such an important part can break so easily! No Sender means you get bounce-backs from any Gmail account at the very least
Hi guys,
a small module to fix it without touching the core:
A simple fix instead of installing a module is to do like below until fixed in next release:
Goto >. ..../vendor/magento/module-sales/Model/Order/Email/SenderBuilder.php Edit function configureEmailTemplate() and add this line $this->transportBuilder->setFrom($this->identityContainer->getEmailIdentity()); to show like below: protected function configureEmailTemplate() { $this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId()); $this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions()); $this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars()); $this->transportBuilder->setFrom($this->identityContainer->getEmailIdentity());
//the below are commented
//$this->transportBuilderByStore->setFromByStore(
// $this->identityContainer->getEmailIdentity(),
// $this->identityContainer->getStore()->getId()
// ); }
Ive removed this revert from my store and gone back to the release version and it is now working fine. I have no idea why so many are seeing this issue anymore. However leaving the release code in place causes any function that sends multiple emails in one operation to send only the first, the remaining emails fail with exception.
@msawyers
@sashas777
I did this: copy from the previous version to: app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
If anyone can reproduce this issue on demand, could they please attempt to diagnose/trace this issue by debug as I am no longer able to reproduce it. If anyone has this fault on a dev install, and would be ok with me connecting remotely to their install to debug then that would be great also. Get in touch.
I have deployed various test stores, vanilla 2.2.4, and 2.2.3 upgraded to 2.2.4 and all work faultlessly.
@gwharton sorry, but on my page when I use the code for app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php from the release, the problem still exists.
Why should it work now, if nothing was changed in the code?
There is no new release, therfore, I really do not understand what you are talking about. Fact is: 2.2.4 is not using Store Email Adresses and Names when sending EMails.
BR Chequille
I upgraded from 2.2.3 to 2.2.4 and it stopped working. I reverted the code to 2.2.3 and it started working again. I changed code back to 2.2.4 and it still works. I deploy fresh 2.2.4 and it works.
I dont know whats going on either.
@gwharton
You can use temporary patch https://github.com/sashas777/bug-from-email It easy to install and it will ask you to do uninstall after the upgrade
@gwharton, just guessing here: you didn't apply any other patches for 2.2.4 which might seem unrelated to this one? Maybe one of those other patches fixes this issue as well somehow ...
Same issue here,from address blank in sales email and SMTP server is not allowing to relay.
Sales email blank from address
Please help to fix the issue
Thanks
Encountered this issue as well in a 2.2.4. Fixxed with the solution from @gwharton .
@sashas777 Great job on the little plugin. Only problem is: Mageplaza PDF invoices breaks after installing the fix.. :-(
@Goeny What error does it give?
@sashas777 It doesnt give an error. It simply does not send the PDF's along with the mail anymore. Can't see any error's in logs anywhere.
@gwharton:
I upgraded from 2.2.3 to 2.2.4 and it stopped working. I reverted the code to 2.2.3 and it started working again. I changed code back to 2.2.4 and it still works. I deploy fresh 2.2.4 and it works. I dont know whats going on either.
Have you by any chance disabled the Amazon Pay module in 2.2.4? There is a report which claims that the Amazon Pay module causes this problem.
I really wonder why reverting to 2.2.3 and upgrade to 2.2.4 worked. Not on my site. Disabling Amazon Payment is causing an error, therefore cannot be the case why it is working.
@chequille: I just tested this myself, and you are right, only disabling Amazon_Payment
causes a problem, because the Amazon_Login
module also references the payment module in its config.xml
file.
So then I tried the same with disabling both: Amazon_Payment
& Amazon_Login
as follows:
bin/magento module:disable Amazon_Payment Amazon_Login
And now my sales emails have a correct sender set:
So it looks like this bug has appeared since those Amazon modules got included by default in Magento 2.2.4, the question is: is it because the thing @kingyond mentioned:
vendor/amzn/amazon-pay-and-login-magento-2-module/src/Payment/etc/di.xml
find this line 63<type name="Magento\Framework\Mail\MessageInterface" shared="false" />
remove the shared string<type name="Magento\Framework\Mail\MessageInterface" />
Or is it because when those Amazon modules do this, that it triggers a previously hidden bug in Magento itself...
This does make sense come to think of it. I recently moved from composer install to github install. When installing via github, you don't seem to get any of the amazon modules by default in 2.2.4 which explains why I can no longer reproduce this issue.
Hi Again, disballed Payment and Login and as expected: it is working again correct. So, question is now, Where is the bug, in Magento or Amazon ?
The poorly implemented fix in #11740 exposed the bug in the Amazon module.
Should this bug be mentioned in both 2.2.4 and 2.2.5 release notes known issues? And work-arounds?
this Issue exist in magento 2.2.5
https://github.com/sashas777/bug-from-email
@sashas777 its not working in magento 2.2.5. good for magento 2.2.4 on magento 2.2.5 Your module says require magento 2.2.4
@vivekaris. Disable the amazon payments module as a workaround.
@vivekaris packaged version updated
Had this same problem in 2.2.5, I was able to get around it by disabling Amazon Pay with the following:
php bin/magento module:disable Amazon_Core Amazon_Login Amazon_Payment
I wish Magento would stop preinstalling stuff we might not need!
@paul-blundell Don't hold your breath. This is obviously a change of direction in order to monetise Magento. They've got to do it some how, and we as a community keep on creating extensions that make the enterprise features seem a little minimal for the fee.
In the meantime, it looks like the https://github.com/sashas777/bug-from-email module has been updated to allow the module to run in 2.2.5.
If you really want to stop modules being included when pulling in via composer, you can add something like this to your composer.json (untested for this specific modue btw):
"replace": {
"amzn/amazon-pay-and-login-magento-2-module": "*"
}
YES, it is confirmed that problem resolved by disabling Amazon Payment.
Preconditions
Magento 2.2.4 PHP 7.1 Cpanel Server
Steps to reproduce
Production Mode Single Store Mode Add product to cart Checkout
Expected result
Order confirmation email with FROM name and email address sent to customer per settings from store email addresses in config
Actual result
Order confirmation email contains no FROM or FROM EMAIL address.