I need to execute my code after submitting shipment. I was using "sales_order_shipment_track_save_after" event in Magento 1.7 but it's not working with Magento 2.1.7 .

I have also tried some other event like "sales_order_shipment_save_after" ,sales_order_shipment_save_before but didn't get success.

event.xml in etc/adminhtml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
  <event name="sales_order_shipment_save_before">
    <observer name="trackShiping" instance="Aftership\Track\Observer\Tracking"/>
  <event name="admin_system_config_changed_section_aftership_options">
    <observer name="index" instance="Aftership\Track\Observer\ChangedSection"/>

Please help me to find the solution.

1 Answer 1


You can refer to answer in following thread. It is similar to your issue.

Magento2 - dispatched event for create shipment

  • Hello @kishan I have tried this too but not working in my case. Commented Aug 4, 2017 at 11:40
  • Wait I upload events.xml code Commented Aug 4, 2017 at 11:41
  • please take a look at events.xml what I am doing wrong @kishan Commented Aug 4, 2017 at 11:48
  • 1
    I realized my mistake actually I was not implementing observerInterface in my observer class that's why problem is coming. Commented Aug 5, 2017 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.