I have created a custom shipping module, it’s possible to make orders with it.
Now I need to figure out how to hook on to the saving of a delivery of the order.
I basically need to run custom code when admin have created a shipment from the order.
How do you do that?
\Magento\Sales\Model\Order\Shipment class, as any other
\Magento\Framework\Model\AbstractModel descendant, fires some events on saving:
Use them to run your custom PHP code.