cancel
Showing results for 
Search instead for 
Did you mean: 

customer_save_after in Magento 2?

SOLVED

customer_save_after in Magento 2?

Hello there,

I'm looking for an observer event relevant to customer_save_after in Magento 1.x. This event should be global events for a better world.

 

At this moment I have to hook into 2 events: adminhtml_customer_save_after and customer_register_success

I'm now considering to switch to customer_save_after_data_object, but I'm not sure that is a correct way to do this.

 

Please give me your advise, suggestions. Any help would be appreciated

Thanks.

I am a high-functioning psychopath.
1 ACCEPTED SOLUTION

Accepted Solutions

Re: customer_save_after in Magento 2?

Magento 2 triggers the same «customer_save_after» event: https://mage2.pro/t/1229

View solution in original post

3 REPLIES 3

Re: customer_save_after in Magento 2?

Magento 2 triggers the same «customer_save_after» event: https://mage2.pro/t/1229

Re: customer_save_after in Magento 2?

I'm using observer event which listed here: https://cyrillschumacher.com/magento2-list-of-all-dispatched-events/

And «customer_save_after» is not available in that list. It makes my concernation. 

 

Thanks for your answer.

 

P/s: Is it safe to use it as a global events?

 

I am a high-functioning psychopath.

Re: customer_save_after in Magento 2?

The customer model extends the AbstractModel and here you have the following event triggered in the before/after save methods:

 

$this->_eventManager->dispatch($this->_eventPrefix . '_save_after', $this->_getEventData());

 

And in case of customer model, $this->_eventPrefix = customer so you can use the event customer_save_after