Magento – Get User credentials with an Observer on customer_register_success event

event-observerregister

At the moment, I have an observer that fires on the customer_register_success event. this observer comes with a property ["customer"]. Is there a way to retrieve the email + password from this object, without modifying the core Magento code?

Basically, the use case is that a non Magento account must be created at another application, whenever a new customer registers through the Magento store.

I appreciate any help!

Best Answer

You can retrieve the customer data like this.

$customer = $observer->getCustomer();
$data = $customer->getData();
// Examine $data

However, I think the password is hashed at this point. Take a look at $data first and go from there. If it's not possible to retrieve password, you can create another observer that hooks onto an event where the password is still plain, cache it in the observer, and retrieve it in your observer that hooks onto the success event.

Related Topic