"Send From" emails on a per message basis are also under consideration.
A) Users on a followup BEFORE the one added proceed as normal, receiving the new followup in turn.
B) Users on a followup AFTER the one added proceed as normal and never receive the new message.
"Send From" emails on a per message basis are also under consideration.
I am hesitant to use JavaScript validation as it can be defeated easily. For example, someone could simply set up a form to post to your script to submit unexpected data.
While I'm at it, I should also make custom fields unlimited. Instead of changing the user database table, breaking everyone's custom scripts, I could deprecate the user1 thru user10 fields and remove them later on with fair warning.
Hmmm... not sure how it is defeated, can you explain?
... so if you're going to do that, just provide us with a SQL script to move them over to the new tables
1. Message Importance: high, medium (normal), or low
One client often wants me to mail out an urgent email to his list and I can't accomodate this request when he does.
added a feature that allows you to enter completely CUSTOM SQL for user selection instead of rules.
"Now", "Date", "Daily" (with days of the week beside it), "Weekly" (with the "start date" beside it), and "Monthly" (also with the "start date" beside it).. Not too hard, really. I'll see what I can do. If I missed something let me know
I've got to stop jumping on these free modifications all the time and getting sidetracked.
Followup1 - Monday (regardless of when user joined list)
Followup2 - Wednesday (after the Sunday mailing - followup1)
Followup3 - Sunday (after the Wednesday - of followup2)
Followup4 - Thursday (after the Sunday of followup3)
---- NOTE change of scheduling here ----
Followup5 - Monthly on 3rd of Month
Followup6 - 5 days after Followup5
Followup7 - Monthly on 3rd of Month (hits the next month)
Followup8 - 5 days after Followup7
.... etc, etc, with these, until possibly RESTART With Followup5 (but NOT restarting from the beginning, and NOT including Followup1-4 in the Restart).
Don, thanks for your suggestion! I will consider releasing less, more often, in order to keep the hype alive.
What if I simply used a 3 parameter cron-style timing? (omitting hour and minutes or, in the future, just minutes) That would be a heck of a lot easier to program and work into the interface
As for 6 and 8 - this is the tricky part. I have an idea: "sub"-scheduled messages - basically a followup attached to a scheduled message...
I am not sure I can do this without creating a new table to hold the dataworking, HOW would you see this new table working, and what layout would it be? I have a BSCS degree with concentration in Database Design, so doing things like Normalizing tables for performance are what I'm used to working with... if you tell me what you're tyring to do, I'll spend some time optimizing how you could do that with the tables... though, I don't believe it's necessary, tell me first why you need to 'sub schedule'?
What if I simply used a 3 parameter cron-style timing?
ok, so maybe implementing the MONTHLY scheduling now and leaving the signup-xtra.php as something to come, or give me quick idea on how to do that, and I'll code it up...
Basically you just need to look at when the next followup occurs and calculate the number of days until WHEN the next monthly date shows up
Ok, I've thought about your 'CRON' approach a little further, and if that helps you and is EASY to implement then GO FOR IT!
As I mentioned, I need this in the next few weeks, if it's possible, let me know, if you need a donation to get moving on this
pay me for this modification. It will benefit all ListMail owners so I'll do it cheap - $50? I can start Wednesday and if I work fast I could have it done by Friday/Monday. Did you want the followup modification
With possibility to CYCLE the followups BACK to First Followup in the list at any time.... but probably at the END of the Followups... How about a 'RECYCLE Followups' option....
Example: 1,2 3,4 5,6
Result: The 1st or 2nd of March or April, but only if it's a Friday or Saturday
1-7 * 1-5
which would hit the FIRST (and only first) week of any month, only if it's Monday-Friday... so, the first Weekday of the month?Code: [Select]1-7 * 1-5
which would hit the FIRST (and only first) week of any month, only if it's Monday-Friday... so, the first Weekday of the month?
Let's say that I want to hit the FIRST Weekday of the month, so I need Monday-Friday, then, I want the NEXT Followup to also hit the NEXT following FIRST Weekday (of the following month).... how would I do that, would the next followup Cron be the exact same as the Cron above?
One further question... since this is how I'll really need it, the First Weekday of any month to START the sequence, and then a delay of 5-7 days for Followup2, and Then a CRON for the Next First Weekday of the Following Month for the Followup3, and then 5-7 days after for the next Followup4....
How is the delay 5-7 days calculated?
... So both methods have a similar drawback but one does not require modifying the user table and has a somewhat higher chance of failure. What do you think? Should I avoid modifying the lm_users table? (I'd like to) Is this the ultimate drawback to cron-style followups?
I was thinking that I do not necessarily need to modify the user table to store the "last followup sent" date/time for each user. Since dailymail is supposed to run every day without fail I could simply run the cron with the "last" time exactly 24 hours before the execution time.
If I stored when dailymail ran I would be able to tell when it didn't run, and could cycle through previous days "mimicking" the execution on alternate days! Hmmm... it's like the anti-skip feature for portable CD players. "[X] Automatically "catch-up" when Dailymail fails" on Config page?
I think I have it, instead I would use a CRON such as this: "7-13 * 1-5" for the second followup which would guarantee that it occurs in the Second Week but only a weekday : ) Great!!!
HOW would the 'catch-up' option try to 'catch-up'? You have to be very careful here, does it try to RUN twice instead of ONCE every time it runs, or what do you have in mind for how DailyMail tries to 'catch-up'?
Also, since you're storing when dailymail runs, why not also show on the Config page (Last DailyMail Execution: dayofweek mm/dd/year hh:mm), and if possible, even allow Admin to MODIFY that, that way Admin would have complete control for modifying when next DailyMail runs... or HOW quickly the catch-up tries to 'catch-up'...
if Admin sees DailyMail didn't run for 7 days, being worried about next execution THROWING everything off, I go into Config, turn Catch-Up ON (if it's off), and then set Last Daily Mail Execution 1 MONTH behind... this provides me with a faster 'catch-up', and GUARANTEES that any CRON style Followup will be caught up exactly to the point where I am now
Ok, that's about it... sounds great, when will it all be ready/fully tested... I'm happy to wait until Monday next week if required? Or, if you want me to setup some of my own TESTING here, I'll test it out on my TestList?
'date' feigning to message codes so date codes are processed based on the previous day(s). This might be an important option for people with time-based messages.
You want to send an email out not the very next Sunday after the last followup, but the Sunday 2 weeks from then. To do this, set up a Delay of 13 and a cron set for "Any Sunday" which is, as per the example above, * * 0
I should be able to give it to you tonight around or shortly after midnight PDT. All of my testing has resulted in success so far but I still recommend you try the new feature on a test installation
Quote:
Let's say that I want to hit the FIRST Weekday of the month, so I need Monday-Friday, then, I want the NEXT Followup to also hit the NEXT following FIRST Weekday (of the following month).... how would I do that, would the next followup Cron be the exact same as the Cron above?
Yes, that's right, but if the two crons are right next to each other you will need to put in a delay of a few days on the second one to get around the days following the first one.
1-3 * 1-5
1-3 * 1-5 DELAY: 4
Cron-style followups can also use the Delay value. Example: You want to send an email out not the very next Sunday after the last followup, but the Sunday 2 weeks from then. To do this, set up a Delay of 13 and a cron set for "Any Sunday" which is, as per the example above, * * 0
is it possible to put in a -13 delay to specify that I need this sent out, for example 13 days BEFORE the CRON set runs out... here's an example... FOLLOWUP1 needs to go out 2 weeks BEFORE 1 year elapses, FOLLOWUP2, 3, 4, etc.. then proceed on DELAYS... after FOLLOWUP1.
Which would mean that FOLLOWUP2 will go out on Dec. 5th, (4 days delay from Thursday December 1st - which basically throws FOLLOWUP2 into the second week in December, instead of the first, is that right?
I'm asking that you allow for a negative delay here ONLY if the CRON schedule is being used, that would allow for the example I posted:
Quote:
is it possible to put in a -13 delay to specify that I need this sent out, for example 13 days BEFORE the CRON set runs out... here's an example... FOLLOWUP1 needs to go out 2 weeks BEFORE 1 year elapses, FOLLOWUP2, 3, 4, etc.. then proceed on DELAYS... after FOLLOWUP1.
I don't think so. The value of Delay is processed BEFORE the cron task, not after.
As for monthly scheduling, etc. I am thinking to provide a "repeat" option, either repeating it a few times or unlimited times.
This might be difficult. Could you simply set your first delay to 352?
I think you should UPDATE your Cron Help Page to make this clearer, I didn't know if the Delay ran BEFORE or AFTER the Cron schedule.
Yes, sure this will work, I just thought it would be nicer to FORCE it into an exact yearly schedule and with leap years it will be off by one, but not bad, 1 day off every 4 years...
I have many lists already setup with DELAYED followups, I am changing those to CRON followups (with NO delay), can you tell me if the CountDOWN takes place as normal, since I see in the User Database that the Delay is currently reading 7, will that Count down and THEN start the CRONs? If it will, I think it's best if I can just SET ALL THE Delays to Zero for these lists right now, and let the CRONs run as if the list just started... can you send me a bit of SQL to reset all of the Delays to 0 in specific lists?
It would be nice to SEE the CRON on the Followup Screen, instead of 'Y', and having to Edit to see what the CRON setting is.
The MySQL query you are looking for is (example for list 1):
UPDATE lm_users SET cdel = '0' where list = '1'
15 2 * * * /usr/bin/wget -O - http://mydomain.com/mail/dailymail.php?pw=xxxxx
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
[<=> ] 0 --.--K/s
Done!<br><br />
<b>Warning</b>: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in <b
>/home3/mydomain/mydomain-www/mail/admin.php</b> on line <b>2499</b><br />
admin-45-You have an error in your SQL syntax. Check the manual that corresponds to your MySQL
[ <=> ] 369 319.48B/s
09:25:08 (319.46 B/s) - `-' saved [369]
list($nbounce)=mysql_fetch_row(mysql_query("select nbounce from $ctable where 1",$link) or die('admin-44-'.mysql_error()));
list($nbounce)=mysql_fetch_row(mysql_query("select nbounce from $ctable where 1",$link)) or die('admin-44-'.mysql_error());
$urows = mysql_query("select id,list,bounces from $utable where email like '$email'") or die('admin-45-'.mysql_error());
Done!<br>admin-45-You have an error in your SQL syntax. Check the manual that corresponds to your [ <=> ] 183 87.23B/s
09:43:48 (87.22 B/s) - `-' saved [183]
$urows = mysql_query("select id,list,bounces from $utable where email like '$email'") or die('admin-45-'.mysql_error());
FOLLOWUP1 CRON: 15-19 * 2-4 Delay: 0
FOLLOWUP2 CRON: * * 1,5 Delay: 2
list($nbounce)=mysql_fetch_row(mysql_query("select nbounce from $ctable where 1",$link) or die('admin-44-'.mysql_error()));
$brow = mysql_query("select nbounce from $ctable where 1",$link) or die('admin-44-'.mysql_error());
list($nbounce)=mysql_fetch_row($brow);
CRONs (followups with delays) being triggered when they should NOT BE!
...is there some problem/reason why FOLLOWUP2 Triggered BEFORE FOLLOWUP1?
PHP doesn't seem to like the "or die()" statements nested.
$urows = mysql_query("select id,list,bounces from $utable where email like '$email'") or die('admin-45-'.mysql_error());
Is there any chance at all some of your users were already on Seq #2? The MySQL statement I provided simply decreased delays to 0 - it was not intended to set all sequence numbers to 1.
What is the proper way to handle the 'or die()' then? Since this statement also fails:
$urows = mysql_query("select id,list,bounces from $utable where email like '$email'") or die('admin-45-'.mysql_error());
update lm_users set cseq = '1', cdel = '0' where list = '32'
Affected rows: 4447 (Query took 0.2094 sec)
Active Users 1-20 of 14335
Are you sure it's all on one line? Do you get an error? I'm not having troubles with this one:
Done!<br>admin-45-You have an error in your SQL syntax. Check the manual that corresponds to your [ <=> ] 183 87.23B/s
09:43:48 (87.22 B/s) - `-' saved [183]
Is there any way you can test the new changes without using your live lists so-as to prevent undesired results with your active clients?
Any ideas? This bombs, so I took out ALL of the 'or die' in the admin.php module after the first error (line 2499 and below).
$urows = mysql_query("select id,list,bounces from $utable where email like '$email'") or die('admin-45-'.mysql_error());
Done!<br>admin-45-You have an error in your SQL syntax. Check the manual that corresponds to your [ <=> ] 183 87.23B/s
09:43:48 (87.22 B/s) - `-' saved [183]
$cmd = "select id,list,bounces from $utable where email like '$email'";
echo "CMD=$cmd<br>";
$urows = mysql_query($cmd) or die('admin-45-'.mysql_error());
$cmd = "select id,list,bounces from $utable where email like '".addslashes($email)."'";
should never be the possibility of a syntax error, unless $utable is somehow undefined.
I'm going to put a few more features in and then will be releasing. It should be ready in the next week or two or maybe three.
$nomaint = 1;
$nosched = 1;
$nofups = 1;
$nobounce = 0;
if($pw) $isadmin = checkpw($pw);
$cmd = "select id,list,bounces from $utable where email like '".addslashes($email)."'";
echo "CMD=$cmd<br>";
$urows = mysql_query($cmd) or die('admin-45-'.mysql_error());
Did you try adding "addslashes()" around the $email variable as I mentioned? If you did, you may not have had a chance to test it. Before doing that I'd be curious to see the output of the query causing the error.
I have finished work on the new dailymail options. You can now disable individual parts of dailymail when running it manually. I have sent the new files to you by email... quite certain I've got it all sorted but please let me know if you notice any errors.
Have your cron-style followups been ok the last few days?
Adding the addslashes solved the problem, as the bounce processing went through the bounces as expected and completed it's execution as normal... so that fixed it! :) Please update your code accordingly, and add the Addslashes code in Admin.php (line 2489).
if(!valid_email($email)) return false;
since I am running from the Command Line, I'm not sure those vars get set in the html code, so I added the code above, to ALLOW bounce processing, and turn off all other processing...
I don't see ANYTHING on the screen when running this from the browser, so generally I run from command line to see what's going on...
if($warn=='no') $outp = 1;
I added the following to the top of bounce() function in admin.php to prevent unnecessary wasting of resources.
I will consider adding a "test mode" for all dailymail operations - good suggestion.
if(($y % '100')==0 && $y <> sizeof($sendq)) sleep(25);
so you could try adding &outp=1 to the URL.
I'm at work on more features for the update.
Think about it, since the bad email address MAY already be in the database, right?
One thing, I forgot again to add my 'throttle code' into admin.php which has cost me many lost emails (and sales)... I suggest again that you consider adding that code, and adding a SWITCH for it in Config, enable Throttle, and include options for setting the number of emails to queue, and the throttle delay time... here's the code again:
A) Users on a followup BEFORE the one added proceed as normal, receiving the new followup in turn.
B) Users on a followup AFTER the one added proceed as normal and never receive the new message.
What about a "Reset all users on [Followup X or EOS] to Seq [ ] Delay [ ]" feature?
remove followups with duplicate seq #s and email data to admin
- update all users on non-existent followup to next followup or eos (end of sequence)
- clear out existing gaps. simple loop through followups on each list incrementing a variable ($i) starting at 1
FOLLOWUP LIST1: 1-5 * 2-4
FOLLOWUP LIST2: 8-12 * 2-4
FOLLOWUP LIST3: 15-19 * 2-4
FOLLOWUP LIST4: 22-26 * 2-4
FOLLOWUP LIST5: 28-31 * 2-3
It would be quite easy to program and schedule a script to run once a month, before dailymail on the 1st, resetting your users to the first followup. Would this solve it?
- added storage of dailymail 'last ran' time. dailymail will not run via cron task until 23h55m from last ran.
- added queue protections to prevent duplicate emails when refreshing the send page or when resuming queues too soon
- added the ability to move or add followups into the middle of a live sequence, inserting them
- added 'smart' followup and user seq # renumbering when adding, inserting, and deleting followups
I could also use the ability to put "NOT" in user selection rules.
SELECT *
FROM lm_users a
WHERE a.list = '2'
AND cnf = '1'
AND NOT
EXISTS (
SELECT *
FROM lm_users b
WHERE a.email = b.email
AND b.list = '3'
AND cnf = '1'
);
That, or an option could be placed within ListMail somewhere to put dailymail into and out of 'test' mode
What do you think about my assumption of 23h55m?
Do you think I need options for how often the 'queue protect' table is updated and how long after a queue has stopped responding to allow a resume? Personally, I think 20 seconds and 1 minute is a perfect balance of speed and stability.
It sounds like you don't want to reset because you have more emails in the sequence.
What about running a custom script before dailymail each day (or just the last few days of the month) that simply skips the message for users on that followup, if required.
The cron code is: 28-31 * 2-3
That followup will ONLY be mailed out if there is a 5th week (that is, a day from 28th to 31st that falls on a Tuesday or Wednesday), that limits the followup to ONLY go out on those months with a 5th week (according to my definition) - a tue/wednesday only with a day of the month of 28, 29, 30 or 31.We could use the same cron-style function, and the PHP date() function, in this custom script to verify when to skip users. We could even check future dates if necessary... How do we determine which months to run it and which months not to? This is a bit confusing.
having a 'TEST MODE' feature would be more useful than having to remember to add &test=1 to the task every time - I think this is the better option.
if that is too confusing - which it may be for other users - then YES - your idea of a custom script sounds fine... when it runs, it would need to run on 28,29,30,31st of the month ONLY and force the FOLLOWUP to SKIP - ONLY if the followup is set (and is the TYPE OF FOLLOWUP I indicated) - do you see the problem here, since some sequences may NEVER have this type of followup setup, and some might...
The cron code is: 28-31 * 2-3
That followup will ONLY be mailed out if there is a 5th week (that is, a day from 28th to 31st that falls on a Tuesday or Wednesday), that limits the followup to ONLY go out on those months with a 5th week (according to my definition) - a tue/wednesday only with a day of the month of 28, 29, 30 or 31.
I have released the latest files!
I added a simple "Reset Users" button on the Followups page, but is it enough? What about a "Reset all users on [Followup X or EOS] to Seq [ ] Delay [ ]" feature? This should/will also be possible with the upcoming mass user operation features.
If the script is run just before dailymail on the same day (ie. at midnight, with dailymail running at 12:05am) then if today (the day the script is run) is the FIRST of the month, advance anyone with the cron timing above to the next followup. If this works as I envision it would be simple and effective. We could run the custom script once a month, on the first, before dailymail.
Update: Your "Copy List" request is now available in the v1.85 update.
dailymail will not run via cron task until 23h55m has passed
I see your point here, and yes, that would work, run a script every AM, I run Dailymail at 4:30AM, so this script would run just before it... so I believe you would need to look for 29th-1st of month - right? That way if the followup is called, ADVANCE to next one, is that right? I see now how this would be a solution. Can you provide me the php code for this script?
<?phpif($pw<>'password') exit();$path_to_lmp = './';include($path_to_lmp.'config.php');include($path_to_lmp.'admin.php');// followup cron timings to check$crons = array('28-31 * 2-3');while(list($k,$v)=each($crons)){ // select all followups with this cron $frows = mysql_query("select list,seq from $ftable where cron = '$v' order by seq;"); if(@mysql_num_rows($frows)>0){ while(list($l,$s)=mysql_fetch_row($frows)){ echo "cron $v found, seq $s list $l<br>"; // get next followup for this list $frow = mysql_query("select seq,del from $ftable where seq > '$s' and list = '$l' order by seq limit 1;"); if(@mysql_num_rows($frow)>0){ list($ns,$nd)=mysql_fetch_row($frow); echo "nextfup found = $ns $nd<br>"; } else { // get list eos $frow = mysql_query("select seq from $ftable where list = '".addslashes($l)."' order by seq desc limit 1;"); if(@mysql_num_rows($frow)>0){ list($ns)=mysql_fetch_row($frow); $ns++; } else { $ns = '1'; } $nd = '0'; echo "nextfup EOS = $ns $nd<br>"; } // update users mysql_query("update $utable set cseq = '$ns', cdel = '$nd' where list = '$l' and cseq = '$s';"); echo mysql_affected_rows() . " users updated on list $l seq $s to seq $ns del $nd<br>"; } } else { echo "no followups with cron $v<br>"; }}?>
This new feature -Quotedailymail will not run via cron task until 23h55m has passed
would really screw things up for me. I have multiple cron entries to send out the followups on different times for different days. I do this to make it seem more 'real', as if I'm sending out the mail by hand.
If this feature can be optional, then I won't have a problem with it.
Something like this, set up to run once a month on the first, before dailymail, should do it
echo "no followups with cron $v<br>";
1 1 1 1 * /usr/bin/wget -O /dev/null -T 0 http://example.com/mail/myphpfile.php?pw=MyDailyMailPass 1> /home/myhome/temp/eowtemp.txt 2> /home/myhome/temp/eowtemp.txt
I'm not familiar with the 1> and 2> are these significant, what is the difference in their use, is it ok to enter as above?
You can also use the password as the first argument if running the script from the commandline.
Update: Your "Copy List" request is now available in the v1.85 update.
Would it be better (more efficient AND stable) to setup the CRONs this way - run them direct from the CRON command line, instead of using WGET?
I do see your Copy List option in the DEMO for v1.85, but I have to ask if you have given the COPY Followup (or series) more thought?
I promised this to a client just before the v1.85 release but held off because I knew everyone was anxious to get their hands on some new code. I have already finished it and it's really sweet. Check this out:
Oh yeah, and I also went ahead and improved the Reset Users option for good measure.
Yeah, that is great, when can the rest of us get our hands on it? That will save me a TON of time!
One question about how it works, when you Save Set, and then Load it in another list, is it possible to Load it at ANY point in the current lists followups, or does it just load it at the end of the sequence?
That looks great too, but what about LOOPING, have you added that yet? I'd like to see a 'Loop User' function, or better yet,
Loop at end of Sequence Loop To Followup xx
Currently the feature simply REPLACES all followups on a given list with the ones from the saved set. (Yes, of course there's a pop-up confirmation) You make an interesting point, though. I could fairly easily provide an additional dropdown to choose * (replace all) or an existing seq # to insert after (what do we do with those followups equal to or ABOVE the inserted #? Move them up or delete them?)
Alan,Quote from: "AlanT"This new feature -Quotedailymail will not run via cron task until 23h55m has passed
would really screw things up for me. I have multiple cron entries to send out the followups on different times for different days. I do this to make it seem more 'real', as if I'm sending out the mail by hand.
If this feature can be optional, then I won't have a problem with it.
Thanks for contacting me. I'll make this optional ASAP and update this post. I do not recommend that you upgrade until then.
Regards