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 events that are fired upon a new customer registration. Does anybody know of an event that is dispatched for that?
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.
event name:customer_registration_is_allowed
I'm not sure if this is you want,you can write a observer to test
I've discovered that the customer_login and customer_session_init events are both thrown on account create. You could register a listener for either and then check to see the create date on the account?
I'm sure this is way too late for your original need, but I'm pleased to report that I discovered how to achieve this today for another client request. It involves using one of the generic controller events. This node in the config.xml
will hook into the right event:
<events>
....
<controller_action_postdispatch_customer_account_createPost>
<observers>
<your_module_here>...etc
The controller_action_postdispatch_REQUESTPATH
event is thrown for every controller that extends Mage_Core_Controller_Front_Action
(which is basically all of them) which makes it very easy to target. Ditto for controller_action_predispatch_REQUESTPATH
.
HTH, JD