I want to integrate sms trigger on sales_order_shipment_track_save_after
event. I have created a custom module and the trigger is being called but I am not able to get orderid from shipment. Following is the code from my observer.
$shipment = $observer->getEvent()->getShipment();
$order = $shipment->getOrder();
$orderId = $order->getIncrementId();
but I keep on getting
Fatal error: Call to a member function getOrder() on a non-object in C:\xampp\htdocs\company\app\code\local\Company\Smstrigger\Model\Observer.php on line 11
can someone please point me to correct code for the same.
Magento version 1.9