Magento 1.9 – How the Newsletter Module Handles Queueing

cronmagento-1.9newsletter

I'm working on a project and the client surprisingly has 90,000 email subscribers from their old site. They want to send out a newsletter when we launch. I'm recommending MailChimp but I'm also curious how well the Magento Newsletter works, could it handle a newsletter shot of that size?

How does Magento queue it's sending newsletters? Does it send them in batches of 50 every 5min or something similar? What kind of impact would this have on server performance. Can you adjust it's frequency?

I imagine this is all done by cron.

Best Answer

Ok, so after checking app/code/core/Mage/Newsletter/etc/config.xml I see that there is a cron set up to schedule the sending on the newsletters, that calls newsletter/observer::scheduledSend:

public function scheduledSend($schedule)
{
    $countOfQueue  = 3;
    $countOfSubscritions = 20;

    $collection = Mage::getModel('newsletter/queue')->getCollection()
        ->setPageSize($countOfQueue)
        ->setCurPage(1)
        ->addOnlyForSendingFilter()
        ->load();

     $collection->walk('sendPerSubscriber', array($countOfSubscritions));
}

I think this means it sends 3 batches of 20 subscriptions every CRON cycle which on our server is every 5 mins. Not 100% sure on this but will keep looking.

Related Topic