magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.31k forks source link

Confirmation emails have no FROM or FROM email address 2.2.4 #14952

Closed tstamplis closed 5 years ago

tstamplis commented 6 years ago

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.

ankit1388 commented 6 years ago

@DanielRuf this is good article i found https://support.magento.com/hc/en-us/articles/360005484154-Create-a-patch-for-a-Magento-2-Composer-installation-from-a-GitHub-commit

DanielRuf commented 6 years ago

support.magento.com/hc/en-us/articles/360005484154-Create-a-patch-for-a-Magento-2-Composer-installation-from-a-GitHub-commit

Ah right, this article is the one that I meant.

prayagr commented 6 years ago

The issue affects 2.2.4 and 2.2.5 - we have resolved it for 2.2.6 and later versions. Fix: https://github.com/amzn/amazon-payments-magento-2-plugin/pull/288

inkobject commented 6 years ago

Just upgraded to 2.2.5 and have run into this issue.

@prayagr, When will 2.2.6 be released?

prayagr commented 6 years ago

Hi @inkobject , I am not sure of the exact release date, but to implement this change for your current setup, you only have to make a minor change as seen here: https://github.com/amzn/amazon-payments-magento-2-plugin/pull/288/files

Cristiano81 commented 6 years ago

the issue is still present in 2.2.6 @ankit1388 solution worked for me

rishabhchd19 commented 6 years ago

the issue is still present in 2.2.6 @ankit1388 solution worked for me

Only the soln is - disable amazon pay.

MartinAarts commented 6 years ago

Solution is work perfectly here

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() // ); }

Although this is not a good practive, this does fix our problem on Magento 2.2.6.

prayagr commented 6 years ago

Hi @Cristiano81 , @rishabhchd19 , @MartinAarts - Sorry to see you are still facing issues with the email address 'From' field. We are not able to reproduce the issue on a fresh 2.2.6 setup, can you confirm that you recompiled and flushed the generated classes?

Also, we would like to observe the issue to debug. If possible, please reach out to us on payments-cp-devel@amazon.com with details.

salelsol commented 6 years ago

I'm trying all viewed solutions about this issue, but nothing works on 2.2.6. Many mail from my store are now spam because this issue: 550-5.7.1 'From' header is missing.

robertkent commented 6 years ago

@salelsol disabling these modules works for me - obviously not going to help if you're using any of them!

php bin/magento module:disable Klarna_Core Amazon_Core Amazon_Login Amazon_Payment Klarna_Ordermanagement Klarna_Kp Vertex_Tax

salelsol commented 6 years ago

The following modules have been disabled:

salelsol commented 6 years ago
CompactCodeEU commented 6 years ago

@salelsol I have made a PR for your issue. https://github.com/magento/magento2/issues/16355#issuecomment-399668596 PR : https://github.com/magento/magento2/pull/16356

This works for my customers

manojind commented 6 years ago

Just install a small module on your magneto 2.2.5 that will work

https://github.com/manojind/magento2.2.5-email-sender

salelsol commented 6 years ago

Hi @manojind: This repository is empty.

wouter-toppy commented 5 years ago

ive the same issue on Magento 2.2.6 With 2.3-beta18

but im not using the amazon plugin.

im currently writing my own plugin which sends mail to Postmark of SES. it has worked till 2.2.5 with an 2.3-alpha61 or lower i believe.

gwharton commented 5 years ago

On 2.2.6 without amazon module, when Magento sends multiple emails, the first has the correct from address, the second and remaining emails don't.

And on 2.3-develop no emails whatsover have a from address, and even if that is fixed, the core Magento code for sending emails has had the "from name" part of it removed for some crazy reason.

I submitted PR's to magento to fix all of the above but they were rejected. Oh well.

DanielRuf commented 5 years ago

I submitted PR's to magento to fix all of the above but they were rejected. Oh well.

Can you link them here so we can take a closer look?

gwharton commented 5 years ago

18471 #18472 #18473

oviliz commented 5 years ago

I can't believe this is still an issue in 2.2.6...

gwharton commented 5 years ago

The worst part is 2.3.0 is going to launch with it too! Although it looks like I have finally got agreement on a way forward with the PR's. They're gonna be in 2.3.1 and possibly 2.2.7 depending on how quickly I can get em through.

iget-master commented 5 years ago

No one will fix this?!

gwharton commented 5 years ago

2.3 fix is approved, awaiting merge, due to be in 2.3.1. 2.2 fix is on hold, presumably will be merged after 2.3 fix has been merged.

xpoback commented 5 years ago

Has this been fixed in 2.2.7?

thanasisgalanis commented 5 years ago

This issue still exist in 2.2.7!

JeroenBoersma commented 5 years ago

I did a composer update to 2.2.7 and this is resolved, this was caused by amzn/amazon-pay-module and in the latest bundle for 2.2.7 the line in di.xml for this module is removed so this should work.

salelsol commented 5 years ago
heldchen commented 5 years ago

also affected in 2.2.7 with all amazon modules disabled.

gwharton commented 5 years ago

Have you tried applying PR #18472

salelsol commented 5 years ago

@gwharton , I just modified the 4 files also flushed magento cache, but nothing changes header email without sender. Should we do more ??

gwharton commented 5 years ago

php bin/magento setup:di:compile php bin/magento setup:deploy

Aswell

salelsol commented 5 years ago

@gwharton ; thanks for your help but issue still remain the same.

rishabhchd19 commented 5 years ago

As I am able to see - https://github.com/magento/magento2/pull/18471/files/f171c9d6ab035439ffb6374ec14dd8d51123dcd2#diff-134b78852b9ecf820540911b665d6566 has resolved the problem in 2.3.0.

gwharton commented 5 years ago

18471 is fix for 2.3 approved but not merged yet

18472 is fix for 2.2 currently on hold, would imagine will be merged once 2.3 fix is applied.

rishabhchd19 commented 5 years ago

18471 is fix for 2.3 approved but not merged yet

18472 is fix for 2.2 currently on hold, would imagine will be merged once 2.3 fix is applied.

I have tried backing up the files and merged manually to the original source in 2.3. As it is verified & approved, I can rely on this fix. My testing is positive after making changes to all these 7 files. Haven't tested "Order emails not send to Admin in BCC" yet.

gwharton commented 5 years ago

"Order emails not sent to admin in Bcc" was fixed in this commit. https://github.com/magento/magento2/commit/9a7c9e553b1c9814907105388bffc2e8a91353a5#diff-dfb3ee5a7f863458afea75f5524cd2e5

That fix is present in 2.2.7 and 2.3.0.

Note, that 2.3.0 also has a separate email issue where the from address is set, but not the from name. If you run into that, then the fix for that is included in #18471 which is scheduled to be included in 2.3.1.

salelsol commented 5 years ago

Mail delivery failed: returning message to sender This message was created automatically by mail delivery software.

salelsol commented 5 years ago

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()

robolmos commented 5 years ago

It looks like this issue is missing again from the "known issues" section in the release notes for 2.2.7 and 2.3.

DanielRuf commented 5 years ago

Please do not directly change core files and create and apply patches with composer-patches.

csdougliss commented 5 years ago

When will this bug be fixed? I am getting this in 2.3.0.

gwharton commented 5 years ago

According to the PR. Should be in 2.3.1

JamesP81 commented 5 years ago

When will 2.3.1 be available? Looking to get this fixed in a month or so.

Userr017 commented 5 years ago

Someone quick fix for Magento 2.2.7?

boostify-pro commented 5 years ago

I am on 2.3 and still having this, any solution without additional modules please.

gwharton commented 5 years ago

As previously stated

18471 is fix for 2.3 approved but not merged yet

18472 is fix for 2.2 currently on hold, would imagine will be merged once 2.3 fix is applied.

You can manually apply these PR's to your install and they will get overwritten on the next release (which will hopefully have the fix)

boostify-pro commented 5 years ago

I am on 2.3 I disables all Amazon modules but still having this problem,

php bin/magento module:disable Amazon_Core Amazon_Login Amazon_Payment I don't find the trick to make it work

rishabhchd19 commented 5 years ago

@Socix, i have tried making changes with PR as stated above by gwharton but not the Patches to see if this resolve the problem or not. Whoooola! it worked. Now i am going to revert back the changes and apply patches with .diff. I hope 2.3.1 will release soon.

boostify-pro commented 5 years ago

@rishabhchd19 thank You, I'm going to try it now