I would like to be able to run some functionality with a module
that I am building whenever a customer registers
an account, but I can't seem to find any event
that is fired upon a new customer registration
.
Does anybody know of an event
that is dispatched for that?
What are Magento 2 Events? Magento 2 events are implemented to run custom code in response to any particular Magento 2 event or custom event. Events are dispatched by modules when certain actions are triggered. When an event is dispatched, it can pass data to any observers configured to watch that event.
In Magento 2, events can be dispatched using the Magento\Framework\Event\Manager class. While developing a custom extension, we need to create a custom dispatch event, so in future, if any other developer needs to extend functionality at that time they can use this dispatch event.
Magento 2 Login as Customer extension is the extension for Magento 2 that allows the admin user to login to customer's account in one click without using a password or changing any authentication data. Once the admin entered the customer account they can perform tests and detect any issues within the “My Account” area.
Whenever I'm looking for an event, I'll temporarily edit the Mage.php
file to output all the events for a particular request.
File: app/Mage.php
public static function dispatchEvent($name, array $data = array())
{
Mage::log('Event: ' . $name); //not using Mage::log, as
//file_put_contents('/tmp/test.log','Dispatching '. $name. "\n",FILE_APPEND); //poor man's log
Varien_Profiler::start('DISPATCH EVENT:'.$name);
$result = self::app()->dispatchEvent($name, $data);
#$result = self::registry('events')->dispatch($name, $data);
Varien_Profiler::stop('DISPATCH EVENT:'.$name);
return $result;
}
and then perform whatever action it is I'm trying to hook into. Magento events are logically named, so scanning/sorting through the resulting logs usually reveals what I'm after.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With