- Require composer-patches:
composer require cweagans/composer-patches - Add the patches section to your
composer.jsonextra field. - Remove existing packages:
rm -rf vendor/magento/module-sales vendor/magento/framework - Run
composer installto re-install and apply patches.
Last active
May 3, 2019 16:39
-
-
Save jerrylopez/84592cff81d0f19944d22ea64e1f7aa5 to your computer and use it in GitHub Desktop.
Asynchronous Email Fix for Magento 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/vendor/magento/framework/Mail/Template/TransportBuilder.php b/vendor/magento/framework/Mail/Template/TransportBuilder.php | |
| index 18b241d77..8b17599e0 100644 | |
| --- a/vendor/magento/framework/Mail/Template/TransportBuilder.php | |
| +++ b/vendor/magento/framework/Mail/Template/TransportBuilder.php | |
| @@ -171,6 +171,22 @@ class TransportBuilder | |
| return $this; | |
| } | |
| + /** | |
| + * Set mail from address by store. | |
| + * | |
| + * @param string|array $from | |
| + * @param string|int $store | |
| + * | |
| + * @return $this | |
| + */ | |
| + public function setFromByStore($from, $store) | |
| + { | |
| + $result = $this->_senderResolver->resolve($from, $store); | |
| + $this->message->setFrom($result['email'], $result['name']); | |
| + | |
| + return $this; | |
| + } | |
| + | |
| /** | |
| * Set template identifier | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/vendor/magento/module-sales/Model/Order/Email/SenderBuilder.php b/vendor/magento/module-sales/Model/Order/Email/SenderBuilder.php | |
| index 7ec089b88..089d35025 100644 | |
| --- a/vendor/magento/module-sales/Model/Order/Email/SenderBuilder.php | |
| +++ b/vendor/magento/module-sales/Model/Order/Email/SenderBuilder.php | |
| @@ -110,7 +110,7 @@ class SenderBuilder | |
| $this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId()); | |
| $this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions()); | |
| $this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars()); | |
| - $this->transportBuilderByStore->setFromByStore( | |
| + $this->transportBuilder->setFromByStore( | |
| $this->identityContainer->getEmailIdentity(), | |
| $this->identityContainer->getStore()->getId() | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "require": { | |
| "cweagans/composer-patches": "^1" | |
| }, | |
| "extra": { | |
| "patches": { | |
| "magento/framework": { | |
| "Fix async email sending transport issue": "patches/composer/async-email-sending-transport-fix-framework.diff" | |
| }, | |
| "magento/module-sales": { | |
| "Fix async email sending transport issue": "patches/composer/async-email-sending-transport-fix-module-sales.diff" | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment