smile-museum / magento2-module-webhook

Webhooks for Magento 2
MIT License
49 stars 15 forks source link

Add 'created' webhooks #1

Open wcurtis opened 9 years ago

wcurtis commented 9 years ago

There's no native customer_create_after event in magento so we'll have to use the customer_save_after and check if the object is new or not.

wcurtis commented 9 years ago

I gave this a shot this evening but unfortunately the isObjectNew() function is always false in the save_after events. Will have to find another way :/

kandy commented 9 years ago

Use plugin instead of events. For example if you intercept ResourceModel::save method you can access to object->getId() method to know is it create or update event.