I have created module and wrote one an observer on "order_place_after", here i want to send the same order email copy to my custom email address.

How can i send the same order email to my custom email address or add that email address as BCC to send order email copy?


  • Why you want it through observer? You can override the order email or use plugin. Commented Dec 19, 2018 at 10:12
  • i have module which has functionality to configure email addresses to each customers from admin side. so when that customer order something then the configured email address also will get same notification. Commented Dec 19, 2018 at 10:19

1 Answer 1


You can managed to work it by follwoing code:

Step 1: Create a module with name Vendor_Module and do the following changes.

Step 2: create di.xml under


with content:

<?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\Model\Order\Email\SenderBuilder" />

Step 3: Create SenderBuilder.php under


with content:

namespace Vendor\Module\Model\Order\Email;

use Magento\Framework\App\ObjectManager;
use Magento\Framework\Mail\Template\TransportBuilder;
use Magento\Framework\Mail\Template\TransportBuilderByStore;
use Magento\Sales\Model\Order\Email\Container\IdentityInterface;
use Magento\Sales\Model\Order\Email\Container\Template;

class SenderBuilder extends \Magento\Sales\Model\Order\Email\SenderBuilder
    protected $templateContainer;
    protected $identityContainer;
    protected $transportBuilder;
    private $transportBuilderByStore;

    public function __construct(
        Template $templateContainer,
        IdentityInterface $identityContainer,
        TransportBuilder $transportBuilder,
        TransportBuilderByStore $transportBuilderByStore = null
    ) {
        $this->templateContainer = $templateContainer;
        $this->identityContainer = $identityContainer;
        $this->transportBuilder = $transportBuilder;
        $this->transportBuilderByStore = $transportBuilderByStore ?: ObjectManager::getInstance()->get(
        parent::__construct($templateContainer, $identityContainer, $transportBuilder, $this->transportBuilderByStore);

    public function send()
        $custom_email = 'YOUR_DYNAMIC_EMAIL_ADDRESS';



        $copyTo = $this->identityContainer->getEmailCopyTo();

        if (!empty($copyTo) && $this->identityContainer->getCopyMethod() == 'bcc') {
            foreach ($copyTo as $email) {

            $this->transportBuilder->addBcc($custom_email); // Added for add BCC for custom dynamic email address

        $transport = $this->transportBuilder->getTransport();

And now run required commands like setup:upgrade, di compile etc. You can modify the codes according to your requirement.

Note: Above codes are not Tested but it should work.

  • how should i use with my observer, as i have already created one observer. Commented Dec 19, 2018 at 11:14
  • @UtsavGupta add your code in question will surely help you out Commented Dec 19, 2018 at 11:16
  • anyone know how I can achieve this but with magento 1.9 Commented Jan 8, 2020 at 11:14
  • 1
    Hello, can I load order here ? I want to add bcc but it is base on some order value. May I get Order in this same function ? Commented Apr 20, 2020 at 11:29
  • @Sukumar Gorai: what do you think plugin can work on this class instead preference. Commented Jun 15, 2021 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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