Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an event for customer account registration in Magento?

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?

like image 393
Prattski Avatar asked Jun 03 '10 17:06

Prattski


People also ask

What are Magento 2 events?

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.

What is dispatch event in Magento 2?

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.

Is Customer login in Magento 2?

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.


1 Answers

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.

like image 75
Alan Storm Avatar answered Sep 30 '22 13:09

Alan Storm