Hi DW,
Sounds great, ok, here's a few things, first you ask:
How is the delay 5-7 days calculated?
This is an interesting question, initially I thought, well, 5-7 days from actual first send, BUT, if I don't know which day IS the first weekday of th e month, that means I also will NOT know the number of followup days to provide for hitting the NEXT Weekday a week ahead followup, so really what I need is Followup1 - First Weekday of Month, Followup2 - Next available Weekday of Month ONE WEEK LATER (only if that is at least 5 days)... does that make sense, for example, if this month, I hit First Weekday on Tuesday - November 1, 2005, THEN, I want Followup2 to hit next week on Monday November 7, 2005, BUT only IF the number of days between Followup1 and Followup2 is AT LEAST 5 days... so in this example it would be at least 5 days and so ok, so you tell me - would I use CRON and also include DELAY to do something like that - I think I figured it out, see next paragraph...
For another example, if the First Weekday of Month was on a Thursday, for example Thursday December 1, 2005, THEN since the next followup Weekday one week ahead from that is Monday December 5, 2005 IS LESS THAN 5 days out, I need to make an adjustment and wait another day. oh 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!!!
... 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 think it would be best if you did NOT modify lm_users, adding data there will only INCREASE exponentially the amount of total disk space I use, I have enough subscribers that adding anything there adds quite a bit to my database size....
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.
Yes, I think this is a better option, and I like what you say at the end BEST:
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?
This is BRILLIANT, good job.... yes, I believe this is the best solution, you STORE when DailyMail last ran - date/time or whatever you need (IN CONFIG or somewhere other than in lm_users, store it only once), then provide the 'catch-up' option, but tell me 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'.... is this possible, in other words, 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
One requirement of allowing Admin to personally set the Last DailyMail Execution is that they MUST get the correct dayofweek OR it will cause problems... unless you do NOT let them set that, that would be best, show the last Daily Mail Execution as indicated above, let Admin set the mm/dd/year hh:mm, but do NOT let Admin set dayofweek... then you calculate dayofweek when you do your 'catch-up'...
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?
Let me know either way...