I want to know, which file responsible for sending an email to customer when a shipment is created by admin (IF CHECKED Email Copy of Shipment
)
1 Answer
You can check this file..
vendor/magento/module-shipping/Controller/Adminhtml/Order/Shipment/Save.php
if (!empty($data['send_email'])) {
$this->shipmentSender->send($shipment);
}
If Email Copy of Shipment
checkbox is selected in Backend and you will try to Submit shipment
then this code will send email to customer.
vendor/magento/module-sales/Model/Order/Email/Sender/ShipmentSender.php
And in above model file there is send()
function available, that will send email to customer.
Hope it will help you!
-
I also want to change the email address of recipient. Can you please tell that? Oct 31, 2019 at 12:10
-
It means you want to send shipment email to different email, not customer's email ? or something else ? Oct 31, 2019 at 12:15
-
-
1You can check this file. vendor/magento/module-sales/Model/Order/Email/Sender.php this may be helpful to you. There is one line $this->identityContainer->setCustomerEmail($order->getCustomerEmail()); that set customer's email in prepareTemplate() function. You can add conditions there based on your requirements. Oct 31, 2019 at 12:32
-
1