-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.3] Alternative fix for Multi Store Emails issue, Fix Async Emails issues, Fix Multiple Email issues #18471
[2.3] Alternative fix for Multi Store Emails issue, Fix Async Emails issues, Fix Multiple Email issues #18471
Conversation
Can you please reopen? |
TODO : Rest of Magento codebase still uses deprecated setFrom
Note, in testing 2.3-develop, emails will not have a from name set. This is due to bug #18470. |
Hi @gwharton, |
Just waiting on travis to pass and I should be done. I know there are lots of usages of the now deprecated function within the magento codebase, but I'm not proposing to update any of them in these PRs. Seems a little beyond scope and also a testing nightmare to change all in one go. I can audit the codebase and compile a list of areas that could do with looking at in the future if that would help. |
Fix small issue
Hi @gwharton, Unfortunately this change will not be included in 2.3.0, so as part of 2.3.x release line - it's not backward change. Could you do the same changes as I requested for 2.2.x release line? Sorry for confusing you. Thank you |
@ihor-sviziev All done. |
Hi @gwharton, thank you for your contribution! |
Hi @gwharton. Thank you for your contribution. |
…Async Emails issues, Fix Multiple Email issues #18471
You can use cweagans/composer-patches and below patches for Magento 2.3.0
|
This isn't working to my system as no file is being updated when I put the zip files in folder patches/composer/ . I ran setup:di:compile & setup:static-content:deploy -f after setup:upgrade but neither it is patching up files with http://mydomain.com/patches/composer/PR-18471-Sales.diff nor with the path patches/composer/PR-18471-Sales.diff. Problem with both the patches. |
@rishabhchd19 : you need to put the After that, you can run There's also some information over here ("Apply a patch" section) which more or less tells you the same. |
yeah...silly mistake. Got your point. Thanks @hostep |
I apply this patch to 2.3 and then mageplaza smtp gives this error on test send Zend\Mail\Transport\Smtp transport expects either a Sender or at least one From address in the Message; none provided |
Hi @snoroozi, |
Does this patch work for 2.3? Because on my 2.3 version I applied these patches correctly. On composer -v install it changed the code with diff. Ran setup:upgrade, cache:clean, setup:di:compile, setup:static:content:deploy. Still emails sender is www-data. I checked Magento 2.3-develop brach and code is different than on patch. It uses setFromByScope https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php Does anyone have working patch for 2.3? |
The change to setfrombyscope was just a wording change. Are you using any third party email modules that could be overriding core functions? |
None of 3rd party modules override these core functions. Also cleared these : rm -rf var/cache/* var/page_cache/* var/di/* var/generation/* var/view_preprocessed/* pub/static/* generated/code/* |
I don't know what else to suggest. I've just redeployed 2.3-develop and tested sending newsletter emails, sending sales email in synchronous mode, and sending sales emails in asynchronous mode. All set the correct sender details. Either the patches aren't applied correctly, or something is overriding core where you arent expecting it. try as a double check.
Are you able to reproduce in a dev environment. Can you debug using xdebug? How about disabling all modules and see if issue is still there. If not reintroduce modules a few at a time. All ways in which I've tracked down unexpected behaviour in the past. |
Heres how I applied patch: in project directory patches/composer/ added: Then ran composer -v install and composer update --lock. Then Also none of the 3rd party modules extend patch function and UPDATE: |
@trenox2121 I never got this patch to work either and also correctly applied. Would love to see someone package it up more simply |
Magento 2.3.1 still implementing setFromByScope instead of setFromByStore in Framework/Mail/Template/TransportBuilder.php causing some other emails, like Recover Password email, not being sent.
@gwharton Any idea why the Magento team didn't fully implemented the proposed PR ? |
SetFrom and setFrombyStore are deprecated and call the framework function setFrombyScope. Anything that used setFrom or setfrombystore should still work. New code shoukd use setfrombyscope. The initial fix of setfrombystore was renamed to setfrombyscope as framework functions should not be store aware. (Renamed via deprecation) |
Oh hang on. I see. The deprecated function setfrombystore has been removed. Yes i imagine this would break things!!! |
is there a way to backport this to 2.2.4? |
You can look at #18472 |
Will this fix Magento 2.3.0 seemingly just exiting the script when trying to notify Invoice & Shipping emails? |
Description
This PR removes the previously introduced transportBuilderByStore class that was introduced in 2.2.4 to fix issue #11740 as this implementation caused unwanted regression/bug when sending multiple emails/async emails.
Fixed Issues (if relevant)
Manual testing scenarios
Scenareo 1
Scenareo 2
Contribution checklist