Magento Newsletter
18 Comments 23rd JUL 2009 | Posted by Toni Anicic in Magento, Online Marketing

If you’re using Magento you probably noticed by now that you have integrated newsletter system with it. By default, visitors are able to subscribe to your newsletter via Magento Newsletter subscription form in sidebar.
Besides newsletter subscribers, all of your store’s registered users will also appear in your Magento’s newsletter e-mail database. This database also contains information on different store views, allowing you to easily send multiple variations of your newsletter to different store view subscribers. This feature is extremely useful when dealing with multiple language web shops.
How to send a Magento Newsletter?
Newsletter Template:
The process of sending out Magento Newsletter starts with creation of Newsletter Template. Once you create this template, the template will remain there even after you send your newsletter to subscribers, allowing you to change it and use it multiple times. You can create multiple newsletter templates with different styling and test them to see which one attracts the most response from subscribers.

Simply click on “Add new template” button on the right and start creating your first newsletter template. You will see a screen with 5 fields. All of the fields are required. You will also notice that the largest field (“Template content” field) already has some sort of code inside. Do not remove this code. This code will generate the unsubscribe link for your newsletter. Make sure that whatever you do this code remains on the bottom.
When creating newsletter template for Magento, note that you can actually use HTML in it. This means that if you’re not a tech savvy person, you can simply use some WYSIWYG editor and copy / paste the code it creates into your newsletter template once you’re done. In addition, if you wish to have WYSWYG editor inside your magento, check out our article on how to use TinyMCE with Magento.
Newsletter Queue:
If you open this tab in the newsletter top menu, you will notice that there are no newsletters in queue. In order to queue a newsletter you need to open “Newsletter Template” screen once again and in the action box next to your template choose “Queue Newsletter”. This action will bring up the “Edit Newsletter” screen. Notice that you can choose which store view subscribers are going to receive the newsletter. To select multiple store views, hold Ctrl key and left click on store views you wish to use. (this will only be necessary if you’re using more then one store view).

You also need to set a Queue date start. Notices that the date and time you set are in fact server date and time, not your date and time. If you wish to send your newsletter immediately, you need to set it to your current server date and time or set it into past.
Newsletter Subscribers Export:
If you wish to use some other service for sending your newsletter you can easily export your Magento newsletter subscribers via admin panel. Access the “Newsletter Subscribers” screen via top menu. On the top right you will see select box with options to export your newsletter subscribers in form of CSV or XML. Export it in a form that best fits the import options of your other newsletter solution.
Can’t send Magento newsletter? Here are some common problems:
- Your server time is different then your local time and you’ve actually queued the newsletter to be sent a few hours in future and that’s why it’s not sent right now.
- Magento sent only small part of emails? Don’t worry, it will send them out. Magento has integrated limit on the number of emails it can send at once. Eventually, all of your emails will be sent.
- You might need to activate your cron job as it’s often a case cron job is causing you problem. This means you will need to visit this address insert-your-magento-store.com/cron.php manually with your internet browser.
To post code in comments, place your code inside [code] and [/code] tags.


















October 20th, 2009 at 5:38
Hi,
Yesterday we had a problem with sending client newsletter from magento. There was no start option underneath the action dropdown.We used a method to manually send the mails after the mail was queued in the newsletter queue. Just type http://yourdomain.com/newsletter_queue/sending/id/(queueid of newsletter) and press enter…;)…you may have to do this more than once to send to all recipients..hope this helps some one..
Regards
Anoop
October 20th, 2009 at 7:11
@anoop
That’s not a problem, there IS NO START BUTTON
Read the post again
October 20th, 2009 at 7:58
@Toni Anicic
Actually there is a start option in the drop down under the Action column. In our case it was’nt showing. Thats why we had to use this method..[:P]
January 12th, 2010 at 7:39
If U give code and live demo how this newsletter Work So it’s more Better To Understand But this will also help full
whatever, THANX
February 1st, 2010 at 20:19
Thanks Toni, I owe you a beer! Who said programmers can’t learn from marketing guys
February 2nd, 2010 at 11:04
Toni, thanks for this tutorial. Can you explain where the “integrated limit on the number of emails it can send at once” is found?
Tonight we scheduled an HTML newsletter with 470 subcribers, you know a very small group. Newsletter code was professionally created, all images external.
To our surprise, Magento filled out the mail server to death.
There really needs to make this “integrated limit” visible in the configuration. So the admin can choose a batch size compatible with available resources.
February 2nd, 2010 at 11:18
@Next,
Not sure where the limit can be seen or configured in code, but I’m 100% positive that Magento will not send all e-mails at once.
February 2nd, 2010 at 12:37
Ok, in the meantime I found out where the value is. Two locations:
1)
\app\Code\Core\Mage\Adminhtml\Controllers\Newslette\Queuecontroller.php
Inside “public function sendingAction()” > $countOfSubscritions = 20;
2)
\app\Code\Core\Mage\Newsletter\Model\Observer.php
Inside “public function scheduledSend($schedule)” > $countOfSubscritions = 20;
So default limit is 20, which is a pretty conservative batch size. Good.
Tonight cron was configured to run each 15 minutes. It ran two times, then I see no more “cron.php” entries in the server log.
20 x 2 = 40 => Subscribers 1 to 40 should be marked “sent” in newsletter admin.
Instead, Magento admin marks users 1 to ***300*** as sent. The mail server queue had 180 e-mails when it died.
Do you agree that problem was probably cause by strange behaviour of cron.php? Did you experience anything wrong with it on your projects?
Thanks!
February 2nd, 2010 at 12:58
I think script runs multiple times when cron is activated, it sure isn’t sending 20 every 15 minutes, it’s sending more (even with default installation).
However, I’m not a programmer so I can’t give you any answers from that perspective
February 2nd, 2010 at 13:06
Thanks for the suggestion, maybe you are pointing me in the right direction.
February 13th, 2010 at 12:20
Thank you for your sugestions. Keep posting.
March 24th, 2010 at 16:52
Thanks for your help guys i’m just about to send my first newsletter
March 29th, 2010 at 22:55
Hi Guys. Trying to send a newsletter for the first time. I cant seem to get it to work.
The drop down box on the newsletter wueue only contains the option “preview”. I tried schedulng a send out both in future and past, but no newsletter gets sent.
On the previous post it states that you may be able to kick off the cron job manually. Where is the cronid the url calls for? I know it must be something dumb I am doing because its my first time, but cant seem tget it to work.
Any advice would be greatly appreciated.
March 29th, 2010 at 23:32
@Sigi,
Set it in past. If your store is installed on the root of domain, just visit example.com/cron.php with your browser. If it’s not in root, add the folder where Magento is before /cron.php
If this doesn’t work, there might be somethign wrong with your configuration.
March 30th, 2010 at 15:15
Many many Thanks Toni. This worked and kicked off the process.
April 12th, 2010 at 15:57
Does anyone know of a variable to put in the newsletter template, that will allow the user to view an online version? Like you can preview it from the admin area.
May 27th, 2010 at 16:32
I’ve tried everything and can’t get my newsletter to run. I have tried all sorts of times and I have pulled the file via the search bar. When I do that all I see is a white screen but no emails are sent. This is my cron file.
require ‘app/Mage.php’;
if (!Mage::isInstalled()) {
echo “Application is not installed yet, please complete install wizard first.”;
exit;
}
// Only for urls
// Don’t remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), ‘index.php’, $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), ‘index.php’, $_SERVER['SCRIPT_FILENAME']);
Mage::app(‘admin’)->setUseSessionInUrl(false);
try {
Mage::getConfig()->init()->loadEventObservers(‘crontab’);
Mage::app()->addEventArea(‘crontab’);
Mage::dispatchEvent(‘default’);
} catch (Exception $e) {
Mage::printException($e);
}
Any ideas here… I’m clueless but I need to send out emails. Thanks
August 6th, 2010 at 10:09
Hi guys,
I have cron job :
require 'app/Mage.php';
if (!Mage::isInstalled()) {
echo "Application is not installed yet, please complete install wizard first.";
exit;
}
// Only for urls
// Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);
Mage::app('admin')->setUseSessionInUrl(false);
try {
Mage::getConfig()->init()->loadEventObservers('crontab');
Mage::app()->addEventArea('crontab');
Mage::dispatchEvent('default');
$ob = Mage::getModel('catalogrule/observer');
$ob->dailyCatalogUpdate("0 1 * * *");
} catch (Exception $e) {
Mage::printException($e);
}
?>
When I set a newsletter template and assign in queue, it showing ‘Not sent’ but when I run cron.php manually. after some time it showing ‘Sent’. But no any mail comes on subscribers email addresses.
Anyone can do help me to retrieve this problem?