Until this becomes a feature, here's a hack:
Copy dailymail.php to dailymail2.php. Edit dailymail2.php as follows:
Change "2" to "99" on line 146:
$batid = qstart(99);
This prevents the Dailymail report from being sent when there are messages.
--------------------
Add ",date" to line 446:
$qrows = mysql_query("select id,list,subject,message,htmessage,fattach,date from $qtable where date <= '".date("Y-m-d")."' and type = 'm' order by id");
Add ",$qdate" to line 449:
while(list($qid,$qlist,$qsubj,$qmsg,$qhtmsg,$qfatt,$qdate)=@mysql_fetch_row($qrows)){
The queued date is retrieved for comparison later.
--------------------
Add " && false" to line 848:
if($sendq==0 && false){
This disables the Dailymail Report when there are no messages.
--------------------
Add this starting at line 450, after the line "while(list($qid ...":
// BEGIN TIME MOD
$dstime='0000'; // default sending time 0000 to 2359
list($stime)=explode(' ',$qsubj);
if(is_numeric($stime) && strlen($stime)==4) $qsubj=substr($qsubj,strpos($qsubj,' ')+1); else $stime=$dstime;
if(round($stime)>date("Gi") && $qdate==date("Y-m-d")) continue;
// END TIME MOD
This checks the subject for the time and removes it if found, and skips sending if a message is scheduled for later than the current day and time.
--------------------
If you're using the optional daily-xtra.php script, "comment out" lines 841-845, like so:
// if(file_exists('./daily-xtra.php')){
// if($outp) echo "Running daily-xtra.php..<br>";
// include('./daily-xtra.php');
// mysql_select_db($sqldb);
// }
--------------------
Notes / instructions:
- Add &nosched=1 to the regular dailymail.php once-per-day cron task to suppress scheduled message processing, e.g. as follows (note: quotes around URL are important):
0 0 * * * /usr/bin/wget -O /dev/null -T 0 "http://example.com/mail/dailymail.php?pw=YourDailyMailPass&nosched=1" 1>/dev/null 2>&1
- Schedule the modified (see above) dailymail2.php script for every 15 or 30 minutes, skipping 'last ran' checking and updating and suppressing all but scheduled messages, e.g. as follows:
*/15 * * * * /usr/bin/wget -O /dev/null -T 0 "http://example.com/mail/dailymail2.php?pw=YourDailyMailPass&warn=no&nolastran=1&nomaint=1&nofups=1&nobounce=1&noscfup=1&noremind=1" 1>/dev/null 2>&1
- There is currently no report sent to the admin when scheduled messages are sent. It is recommended to set up test addresses on your lists and perhaps enable the SMTP log temporarily to ensure everything is being sent to the server as expected. A custom report could be added fairly easily but I wanted to publish the mod in its simplest form first and foremost.
- To schedule by time, add 4 digits and a space to the beginning of the subject when scheduling messages, e.g. "1234 Example Subject". The dailymail2.php script will read the digits as the time to send (0000 to 2359), and remove them automatically before sending. Note that if any combination other than 4 digits and a space appears it will NOT be processed or removed and the default time as configured in the mod (above set to 0000, midnight) will be used instead.
- All times use the server time zone which can be viewed on the Dailymail page within LMP.