dispatch custom event in Magento

1. A controller dispathes the event register_success and broadcasts the customer data.

Mage::dispatchEvent('register_success', array('customer' => $customer));

2. The event configuration in the module’s config.xml file. It says run the function processCustomerData in the php class PackageName_ModuleName_Model_Observer when the event register_success is happened.


3. The function processCustomerData that reacts to the event ‘register_success

public function processCustomerData(Varien_Event_Observer $observer)
   	$event = $observer->getEvent();
	$customer = $event->getCustomer();
	//Do something with the customer data

Magento observer examples
Magento native event list

Search within Codexpedia

Custom Search

Search the entire web

Custom Search