Closed (fixed)
Project:
Mailout
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Aug 2008 at 03:30 UTC
Updated:
26 Aug 2008 at 16:22 UTC
My ISP limits the number of e-mails I can send out in an hour. The solution I implemented before was to run cron once an hour and to add a LIMIT clause to the SELECT statement that pulls the e-mails to send (see below). Could there be a setting added to the UI for picking the batch size per cron call?
function mailout_cron(){ # mailout 1.0 alpha 2
global $base_url;
//get mailout stats
$result = db_query('SELECT ml.id, l.id as log_id, ml.email_to, l.html, l.stat_track, l.opt_out, l.email_headers, l.email_subject, l.email_body, l.email_from FROM mailout_message_log AS ml JOIN mailout_log AS l ON ml.mailout_log_id = l.id WHERE sent = 0 AND l.scheduled < %d LIMIT 225', time());
Comments
Comment #1
simesure can do. watch this space
Comment #2
creyes123 commentedYou da man!!!
Comment #3
simeI've added the variable check to the latest dev version, but decided not to add a settings page for this just yet.
So for now you can set it like this in your settings.php file:
$conf['mailout_batch_max_emails'] = 10; // Limit emails to send per cron.Comment #4
creyes123 commentedI just installed the new development version. I set the batch size limit per your instructions.
It looks like it sent the first batch right away without waiting for cron. It lied - it had told me that the emails would go out at the next cron run. My ISP discards emails over the hourly limit - that could have really messed me up.
Are substitution codes supported for the subject line and email body? Ie, can I say [email] and have their email address merged in?
Great module, by the way.
Comment #5
creyes123 commentedI changed my cron to run every five minutes. It used to run once an hour. The mailout module is working great. I like the batch time limit that you added - it keeps me out of trouble with my ISP. The batch size limit variable is working beautifully, too.
Comment #6
simeI'm going to put the substitution/token thing on hold for a bit. Just to get a stable release out the door. But its definitely going to be the next thing on the list.
Comment #7
creyes123 commentedThat makes sense.
I used the mailout module twice. The first time it sent the first batch out right away - I know since my cron was not scheduled to run for another half an hour. On the second mailing, it waited for the first cron run. Very odd.
Keeping the time and batch size limits in variables is fine with me, but it makes me very nervous not to have a confirmation in the GUI that the variables were read correctly.
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.