Mage_Newsletter_Model_Observer Class Reference

List of all members.

Public Member Functions

 subscribeCustomer ($observer)
 customerDeleted ($observer)
 scheduledSend ($schedule)


Detailed Description

Newsletter module observer

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 of file Observer.php.


Member Function Documentation

customerDeleted ( observer  ) 

Customer delete handler

Parameters:
Varien_Object $observer
Returns:
Mage_Newsletter_Model_Observer

Definition at line 49 of file Observer.php.

00050     {
00051         $subscriber = Mage::getModel('newsletter/subscriber')
00052             ->loadByEmail($observer->getEvent()->getCustomer()->getEmail());
00053         if($subscriber->getId()) {
00054             $subscriber->delete();
00055         }
00056         return $this;
00057     }

scheduledSend ( schedule  ) 

Definition at line 59 of file Observer.php.

00060     {
00061         $countOfQueue  = 3;
00062         $countOfSubscritions = 20;
00063 
00064         $collection = Mage::getModel('newsletter/queue')->getCollection()
00065             ->setPageSize($countOfQueue)
00066             ->setCurPage(1)
00067             ->addOnlyForSendingFilter()
00068             ->load();
00069 
00070          $collection->walk('sendPerSubscriber', array($countOfSubscritions));
00071     }

subscribeCustomer ( observer  ) 

Definition at line 34 of file Observer.php.

00035     {
00036         $customer = $observer->getEvent()->getCustomer();
00037         if (($customer instanceof Mage_Customer_Model_Customer)) {
00038             Mage::getModel('newsletter/subscriber')->subscribeCustomer($customer);
00039         }
00040         return $this;
00041     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:29 2009 for Magento by  doxygen 1.5.8