I have setup email address in sales representative but getting sales email from


So where I need to fix this issue? Can anyone let me know?

Other emails except sales are working fine.

  • 1
    Please check my ans, as I had same issue before and I have solved it. – Aasim Goriya Sep 8 '18 at 6:10
  • Okay, I am trying. – Vinod Kumar Sep 8 '18 at 6:13
  • ok please let me know if anything – Aasim Goriya Sep 8 '18 at 6:40

Source: https://github.com/sashas777/bug-from-email

Issue on Magento's GitHub Repo: https://github.com/magento/magento2/issues/14952

Please check following steps to resolve this issue.

Create your custom module to rewrite core files

In your /Vendor/Module/etc/di.xml add following code

<?xml version="1.0" ?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Sales\Model\Order\Email\SenderBuilder" type="Vendor\Module\Rewrite\Sales\Model\Order\Email\SenderBuilder" />
    <preference for="Magento\Framework\Mail\Template\TransportBuilder" type="Vendor\Module\Rewrite\Framework\Mail\Template\TransportBuilder" />

In your /Vendor/Module/etc/module.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        <module name="Vendor_Module" setup_version="1.0.0">
            <module name="Magento_Sales"/>

In your Vendor/Module/Rewrite/Framework/Mail/Template/TransportBuilder.php


namespace Vendor\Module\Rewrite\Framework\Mail\Template;
class TransportBuilder extends \Magento\Framework\Mail\Template\TransportBuilder
     * @param $from
     * @param $store
     * @return $this
     * @throws \Magento\Framework\Exception\MailException
    public function setFromByStore($from, $store)
        $result = $this->_senderResolver->resolve($from, $store);
        $this->message->setFrom($result['email'], $result['name']);
        return $this;

In your Vendor/Module/Rewrite/Sales/Model/Order/Email/SenderBuilder.php


namespace Vendor\Module\Rewrite\Sales\Model\Order\Email;
class SenderBuilder extends \Magento\Sales\Model\Order\Email\SenderBuilder
     * Configure email template
     * @return void
    protected function configureEmailTemplate()
        /*Send From Email Issue #Dev110*/
        /*Send From Email Issue #Dev110*/
//        $this->transportBuilderByStore->setFromByStore(
//            $this->identityContainer->getEmailIdentity(),
//            $this->identityContainer->getStore()->getId()
//        );
  • 1
    Perfect...this is working fine for me. thank you – Vinod Kumar Sep 8 '18 at 7:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.