When sending order confirmations, I wish to have them all go to a specified email address and disable them going to the customer.
Please note, this is for internal use, where everything is free and no legal requirements to offer invoices/etc. I need to send data for the order and customer via this order email, formatted so that it can be captured by another system.
I found within Magento/vendor/magento/module-sales/Model/Order.php on line 2501:
/** * Returns customer_email * * @return string */ public function getCustomerEmail() { return $this->getData(OrderInterface::CUSTOMER_EMAIL); } and then again on line 4045:
/** * {@inheritdoc} */ public function setCustomerEmail($customerEmail) { return $this->setData(OrderInterface::CUSTOMER_EMAIL, $customerEmail); } Editing this works, in that I can redirect all emails to a static address ([email protected]) but it also replaces the customer's email as it appears in the order to the same address ([email protected]). I still need to have the CUSTOMER_EMAIL value = the customer's email as I need to send that within the email as part of the email body.
Which is the right file to edit where the sending of the email is executed so I can change the address there?
Thank you very much in advance!