1

I'm aware of the event emitted from CreatePost.php

$this->_eventManager->dispatch(
    'customer_register_success',
    ['account_controller' => $this, 'customer' => $customer]
);

but this is only for frontend new customer event, I have to find the best area to enter some code that runs only once when a new customer is created.

Edit: customer can be created thru frontend, API, admin page. And I need to catch all.

Edit 2: I'm trying to find the last event when a customer is created or edited, I have to run a reindex command after.

Thanks in advance.

  • Saveafter observer is good for you. – Pramod Kharade Jan 25 '18 at 2:16
0

Frontend, Admin, API, we should use Plugin for : \Magento\Customer\Model\AccountManagement::createAccount()

  • Wouldn't that get me the "before" call, where the model hasn't been created yet? – Mac A. Jan 25 '18 at 17:22
  • Actually I don’t know your purpose. I just gave you a suggestion. Can you update your question more details? – Khoa TruongDinh Jan 26 '18 at 0:25
  • One of the 3rd party extensions that I have, has some custom attributes on customer model, and it's forcing me to run a reindex on new customers, and everytime a customer group is changed, I've already tried update on save also, I still need to reindex customer grid every time. – Mac A. Jan 27 '18 at 0:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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