Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Newsletter - how to slow down the sending?


Go to End


3 Posts   1765 Views

Avatar
bones

Community Member, 110 Posts

16 November 2009 at 10:45pm

We need to send out 1500 emails, but our host (in common with many other hosts) block bulk emails if more than 500 per hour are sent out.

Many people do not realise that their hosts do this, and receive no warning that their emails haven't been sent (our host phoned us up and told us last time).

With this in mind, is there a way to slow down the sending of emails from the Newsletter module?

I thought that adding the sleep() command would work, but don't know where to put it.

<?php
    sleep(4);
?>

Any suggestions? Thanks :)

Avatar
smallstudio

Community Member, 7 Posts

15 January 2010 at 3:18pm

Edited: 15/01/2010 3:43pm

I've got the same issue - I'm assuming newsletter/code/BatchProcess.php is where this is defined, but don't know how to do it. Any help would be appreciated!

Avatar
Optic Blaze

Community Member, 190 Posts

10 June 2011 at 8:36pm

The file that you are looking for is NewsletterEmailProcess.php

After the line of code that reads '$newsletter->write();' [line 119]

add the sleep command.... so it looks like this:

$newsletter->ParentID = $this->newsletter->ID;
$newsletter->write();
sleep(8);