Magento newsletter not sending through cron job

13,670

Solution 1

Try to send it manually. Try this one enter image description here 'app\design\adminhtml\default\default\template\newsletter\queue\list.phtml' in this page getChildHtml('grid') ?> this function call the list body

which come from

'app\code\core\Mage\Adminhtml\Block\Newsletter\Queue\Grid\Renderer\Action.php'

add following code in that page but don't make any change in core file, override that file
in your local directory as

'app\code\local\Mage\Adminhtml\Block\Newsletter\Queue\Grid\Renderer \Action.php'

just copy and paste that file in this directory.

Now add the following code in line number 77 before this code $this->getColumn()->setActions($actions);

$actions[] = array(
'url'=> $this->getUrl('*/newsletter_queue/sending'),
'caption'=>Mage::helper('newsletter')->__('Send'),
'popup' =>true
);

Solution 2

Magento Newsletters Not Sending + Solution If you are scratching your head trying to figure out why your Magento is not sending out newsletter emails then this post is what you need.

Magento has a script called cron.php which handles all of the timed jobs that your Magento store has to do. In this list is the task of sending out newsletters. You have to set up your server crontab to run this cron.php script at regular intervals (eg 5 minutes).

Once you do this, you should find that your newsletter will be sent out as expected.

See this page for some instructions

However – here are my simple instructions for a linux server.

  1. Open up an SSH session with your server. (If you can’t do this you are going to have to ask your hosts to do this for you instead).

  2. Browse to the document root of your magento store, the folder with cron.php in there

  3. enter the command

1 pwd This command gives you the current full path. Write this down somewhere

  1. enter the command

which php

This command gives you the path to your PHP binary. Write this down somewhere

  1. enter the command

crontab -e

This opens up your crontab editor which is the system for scheduling tasks on Linux

  1. hit the [i] key to go into insert mode on the crontab editor (vi basically)

  2. on a new line paste the following, but replacing the paths with the paths you got before

*/5 * * * * /path/to/php -f /path/to/cron.php

  1. Hit [esc] then type the command

:wq

This saves the crontab or cntrl + x and Y

  1. Create a newsletter and schedule it to send in 2 minutes time.

It should send.

ref.http://www.edmondscommerce.co.uk/magento/magento-newsletters-not-sending-solution/

Share:
13,670
Hum
Author by

Hum

Updated on June 04, 2022

Comments

  • Hum
    Hum almost 2 years

    I am trying to setup Newsletter in Magento. I have setup the cron.php in webmin and it seems working but its not sending the newsletter through. If I check the cron_schedule table, I can see cron entries there but with 'pending' status infront of them. However, if I execute www.mydomain.com/cron.php it works perfectly and send newsletters out as well as create an entry in cron_schedule with 'sucess' status. I am not sure where the problem is.

    Edit

    Well, after few mins status for newsletter_send_all entry in cron_schedule changed to 'success' but hasn't sent any newsletters out and in magento admin, under 'Newsletter Queue' status is still 'Sending'. What could cause this?

    EDIT 2

    I have wasted two days on this damn thing but still no luck. Bottomline is, if I run http://www.mydomain.com/cron.php in the browser, it sends out newsletter emails. But when I setup crontab for this, it just sits there to watch my face and doesn't send out any newsletters. I have tried:

    1). php -f /var/www/vhosts/mydomain.com/subdomains/staging/httpdocs/cron.php

    2). /usr/bin/php -f /var/www/vhosts/mydomain.com/subdomains/staging/httpdocs/cron.php

    3). wget "http://www.mydomain.com/cron.php"

    4). /usr/bin/wget "http://www.mydomain.com/cron.php"

    Nothings seems working. Tried chmod 777 cron.php, chown apache:apache cron.php, chown root:root cron.php and chown myuser:myuser cron.php... all failed...