protected function _afterDelete() { // Delete the corresponding customer address record $address = Mage::getModel('customer/address')->load($this->getAddressId()); if ($address->getId()) { $address->delete(); } }
protected function _afterDelete() { // Send email notification to admin $adminEmail = Mage::getStoreConfig('trans_email/ident_general/email'); $templateId = 'email_template_id'; $emailData = array('name' => $this->getName()); Mage::getModel('core/email_template')->send($adminEmail, null, $emailData, null, $templateId); }In this example, when a product is deleted, an email notification is sent to the admin with the name of the deleted product. Package library: This method belongs to the Mage_Core_Model_Abstract class that is a part of the Magento Core package/library.