I'm wondering, how to automatically send Shipment information to the customer if Shipment is created from Invoice?
I have set checkbox "Notify customer by email" to enabled by default, but that not work when the shipment is created from Invoice, not separately.
You need to refer below blog for automatic shipment when invoice is generated,
https://www.mageplaza.com/magento-2-create-shipment-programmatically.html
You have to set after invoice is generated in your code.
Hi, thanks for reply! I guess my problem slightly different - i do not need to create shipment automatically, but send notification to customer automatically when shipment is created (manually).
You need to remove condition from file,
vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/Save.php
Just remove conditions from above file,
if ($shipment) { try { /* comment our below conditions */ /* if (!empty($data['send_email'])) { $this->shipmentSender->send($shipment); } */ $this->shipmentSender->send($shipment); } catch (\Exception $e) { $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); $this->messageManager->addError(__('We can\'t send the shipment right now.')); } }
comment conditions and your mail is getting when shipment is generated.
unfortunately this not helped... maybe static content should be re-reployed or something like this?