Customer registration event working and not working on Magento for checkout registration

There is an event on customer register success in Magento. Name of the event is customer_register_success.

The syntax of it

Config.xml code

<config>
    <frontend>
        <events>
            <customer_register_success>
                <observers>
                    <module_name>
                        <type>singleton</type>
                        <class>module_name/observer</class>
                        <method>methodName</method>
                    </module_name>
                </observers>
            </customer_register_success>
        </events>
    </frontend>
</config>

 

Observer Code :

and in Observer.php. Write your desire code.

public function methodName($observer){
   $_requestData = Mage::app()->getRequest()->getParams();
   $_emailAddress = $_requestData['email'];
   Mage::log($_emailAddress, null, '1212.log', true);
}

Note : This event only works if account is created via url: customer/account/create . This event won’t fire when a user registers from checkout.

and in Observer.php. Write your desire code.

Second Event :

There is an event on customer register success in Magento. Name of the event is controller_action_postdispatch_customer_account_createpost.

The syntax of it

Config.xml code

<config>
    <frontend>
        <events>
            <controller_action_postdispatch_customer_account_createpost>
                <observers>
                    <module_name>
                        <type>singleton</type>
                        <class>module_name/observer</class>
                        <method>methodName</method>
                    </module_name>
                </observers>
            </controller_action_postdispatch_customer_account_createpost>
        </events>
    </frontend>
</config>

 

Observer Code :

and in Observer.php. Write your desire code.

public function methodName($observer){
   $_requestData = Mage::app()->getRequest()->getParams();
   $_emailAddress = $_requestData['email'];
   Mage::log($_emailAddress, null, '1212.log', true);
}

Note : This event only works if account is created via url: customer/account/create . This event won’t fire when a user registers from checkout.

and in Observer.php. Write your desire code

Reference : https://stackoverflow.com/questions/2968294/is-there-an-event-for-customer-account-registration-in-magento/5184440

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.