Author Topic: At work on v1.85  (Read 54375 times)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
At work on v1.85
« Reply #60 on: November 26, 2005, 04:47:11 am »
I was reading some old posts in this thread and found a solution I couldn't help but mention.
Quote from: "chufford"
I could also use the ability to put "NOT" in user selection rules.

This is not as easy as it seems.  Once I figured out the query I found it impossible to work into the standard user selection (partly due to the fact that I run an old copy of MySQL that doesn't support the query).  I decided to keep everyone happy and more by creating a "Custom Query" option for User Selection.  I believe this is only possible in MySQL 4 but the query (thanks Martin) to select active users who are not on another list will be:
Code: [Select]
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'
 );

Try a custom query in PhpMyAdmin to see if this might work for you.

This feature will be available when the 1.85 update is released.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Week of MONTH CRON scheduling...
« Reply #61 on: November 28, 2005, 09:04:24 am »
Hi DW,

Wow, all the changes you mention for upcoming release sound great - the auto-resume script is THE BEST - and yes, I would like to see that... as I still get times when I log in and find some of my emails did not go out... would love to see the auto-resume feature added...

Quote
That, or an option could be placed within ListMail somewhere to put dailymail into and out of 'test' mode


I like this idea too - 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.

Quote
What do you think about my assumption of 23h55m?


Sounds fine to me.

Quote
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.


No, I don't think you need options, but then again, others might be on a slow server and it may affect them?  To me 20 seconds/ 1 minute sounds just fine... you know more about server response times,etc than I do so go with the 20 secs/1 minute for now... and yes I do believe it will help you remove the duplicate sending problem...

Anyway, it seems this new version is going to have so many new features it's going to require lots of testing - have you given though to previous posts by others that you should be issuing releases with fewer time between them and letting people download the newer release more frequently - that way you don't have such a HUGE release?

Regarding the CRON style scheduling question I had (see previous detailed messages):
Quote
It sounds like you don't want to reset because you have more emails in the sequence.


Yes, that's right, I do NOT want to reset the sequence, BUT I do want to be able to send out email on the 5th week of the month, when there is an extra week - since I can use that for sending out an additional promotion.

Quote
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.


That sounds workable, though what I had in mind was that this would be BUILT in to CRON style scheduling - perhaps adding a Week of Month optional value (and perhaps a SKIP option) - that when set would look for followups meeting that requirement, if it is met the followup goes out - if it is not met the followup does NOT go out - and is skipped...  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 thing to keep in mind is this:
Code: [Select]
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.

Quote
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.


Yes it is a bit confusing, for me too - what I want to do is fully laid out in previous posts in this thread - the followup ONLY needs to go out if there is a 5th Week of the month - for me that definition means that there is a Tuesday or Wednesday with a day of the month of 28, 29, 30, 31 as indicated above...  BUT, keep in mind that I may NOT have this type of followup setup in ALL sequences, so - I don't know if it's possible, but it sounds like it may be...  you'll need to think about whether it can be done for the situation indicated- ONLY on 28,29,30,31 look for a day of the week, if it is a Tuesday or a Wednesday than RUN THIS FOLLOWUP, otherwise SKIP IT... not sure how you can accomplish that?  That is why I suggested adding this as an option to the CRON scheduling - by adding a WEEK OF MONTH parameter and a SKIP option...  

Let me know if it's possible?
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
At work on v1.85
« Reply #62 on: November 28, 2005, 04:10:04 pm »
Brett,

Quote
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.

Sounds good.  I could enable TEST MODE by default when installing and put "TEST MODE" on the dailymail report so that you know that nothing will happen if you do not toggle the option.

Quote
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-style feature alone could be difficult for some to grasp, so I think it could be confusing for others.  Considering you're the only one who needs this (so far) I think a custom script would be the best way to do it.

Quote
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.

So the custom script would update all users, if necessary, set to receive any followup with that cron code.  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.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
At work on v1.85
« Reply #63 on: November 29, 2005, 12:30:19 am »
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
At work on v1.85
« Reply #64 on: November 29, 2005, 07:02:38 am »
Hi DW,

Quote
I have released the latest files!


 :D Congratulations!  I know this has been a lot of work for you, and I'm sure others will REALLY appreciate the work you've put into this one, I know I've loved the CRON scheduling - brilliant, and works great - I highly recommend it...

With all of the updates including the AUTO-RESUME and the prevention of duplicate mailings, text-only features there will be a lot of testing/debugging going on, good job - I'd really like to see a 'TEST' mode - and I believe it would really help you out allowing others to set LMP into TEST mode, also, as I mentioned previously, a text LOG file would be beneficial for testing such as this - I hope you can consider this in the future...

I'd like to ask again that you think about adding the THROTTLE options into Configuration... you could include a THROTTLE section, with checkbox [] Throttle mail being sent, pause __ seconds for every ___ messages sent.

Quote
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.


No, a simple Reset Users is not enough - I don't see this 'Reset Users' feature, this would be best to include IN THE SEQUENCE, for example when adding a Followup - what we really need is a RECYCLE users option, for example at END of all FOLLOWUPS  I would like to RECYCLE the user back to FOLLOWUP 2, not to the beginning of the list, but to a specific Followup in the sequence.

Quote
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.


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?

I think that in the future you could make your CRON scheduler even more powerful if you include other paramters such as I am describing (Week of Month), also Week of Quarter, or Week of Year etc... and also including a SKIP option to the CRON task, if this followup can NOT be reached - SKIP to the next...

Quote
Update: Your "Copy List" request is now available in the v1.85 update.


Now that I think of it, as you mentioned, the option to create 'SEQUENCES' of followups would be a better option, but I do appreciate the COPY LIST, that's great... and will let you get close to copying sequences.... I realize sequences may be harder to program... this is an alternative, thanks  :)
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

AlanT

  • Posts: 47
    • View Profile
    • http://www.PowerKeysPub.com
At work on v1.85
« Reply #65 on: November 29, 2005, 09:34:00 am »
This new feature -

Quote
dailymail 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.
- Alan

We all have the Power.
All we need are the Keys.
http://www.PowerKeysPub.com

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
At work on v1.85
« Reply #66 on: November 29, 2005, 03:05:42 pm »
Brett,

Quote
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?

Something like this, set up to run once a month on the first, before dailymail, should do it:
Code: [Select]
<?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>"; }}?>


Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
At work on v1.85
« Reply #67 on: November 29, 2005, 03:07:39 pm »
Alan,

Quote from: "AlanT"
This new feature -
Quote
dailymail 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
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
At work on v1.85
« Reply #68 on: November 30, 2005, 01:01:01 pm »
Hi DW,

Quote
Something like this, set up to run once a month on the first, before dailymail, should do it


Thanks a million  :D

Code: [Select]
echo "no followups with cron $v<br>";

One thing I wonder about, you have echos here, since this is running from command line, there's no good way to capture the output unless I use the CRON command to capture the output of this script, something like this:
Code: [Select]
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

This example from your auto-resume CRON entry... BTW, 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?

Thanks again, I appreciate it!
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
At work on v1.85
« Reply #69 on: December 01, 2005, 04:52:44 am »
Brett,

You're very welcome - this is what I do. :D

Quote
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?

The 1> (or just >) and 2> are redirects for output of the program/script.  I read the exact definition some time ago, I think the 2> is for additional error output at the programmers discretion.  We probably only need 1> or > but adding 2> is more thorough and is sure to prevent all output. :)

You can use the paramaters 1> /dev/null 2> /dev/null to suppress all output as desired or remove them to send output to cron or the terminal.  To have output sent to you by cron remove them and add the following line at the top of your crontab:

MAILTO=your@email.com

Note that the password var pw should be 'password'.  You can also use the password as the first argument if running the script from the commandline.

Add the following line near the top of the script:
if($argv[1]) $pw = $argv[1];

Run the script like this:

php script.php password
 or
1. type "which php" to find php, it's probably in /usr/bin
2. add the line #!/usr/bin/php to the top of the file containing the code, <?php will be the 2nd line
3. chmod +x the file
4. run it: ./script.php password

Hope that helps!
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
At work on v1.85
« Reply #70 on: December 01, 2005, 05:26:51 am »
Hi DW,

Quote
You can also use the password as the first argument if running the script from the commandline.


I never knew that was possible!  I didn't know you could RUN a .php file from command line like that, that's really cool!

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?

If this is better - I would prefer to run all of my .php files from the command line instead of using the WGET call... it also makes it easier for testing - though maybe not easier for you - since you'll need to have two versions (one command line, the other standard)?

Quote
Update: Your "Copy List" request is now available in the v1.85 update.


Back to this... 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 appreciate having the Copy List option, but really, when you think about it - the Copy FOLLOWUP, or Copy SERIES would be more useful, I can see a LOT of copy/pasting ahead - if you do not get this into a new version.... think about what you do most often with LMP, besides Mailing, you create/edit and copy FOLLOWUPS, having the ability to COPY these Followups from 1 list to another would be very helpful, but beyond that, having a way to create a Sequence, or Series of FOLLOWUPS that you can Name, and then copy the ENTIRE Sequence or Series would be even more useful....  I hope you can keep that in mind while working on upcoming updates?
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
At work on v1.85
« Reply #71 on: December 01, 2005, 07:52:18 am »
Brett,
Quote
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 don't believe this is necessarily more stable or efficient because of the fact that running from the command-line may have different PHP settings.  For instance, a script that times out at 30 seconds may not time out the same with wget.  I use wget exclusively for this reason and can't guarantee results if running from the command-line.
Quote
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:

1. Normal state


2. Save Set clicked


3. Load Set clicked


Oh yeah, and I also went ahead and improved the Reset Users option for good measure. ;)

4. Reset Users clicked


If an option (Reset/Save/Load) not currently 'showing' it's sub-options is clicked, the other options automatically 'close' their sub-options.

I have a lot planned and just need to do it.  I've realized that I haven't implemented as many features as I could/should have in the past and hope to make it up to you guys. :)  I'll be going through the forum implementing old suggestions, etc. to not only get them out of the way and make ListMail a better program, but also to make my clients feel important and heard. :)

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
At work on v1.85
« Reply #72 on: December 01, 2005, 08:27:23 am »
Hi DW,

Quote
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:


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?  I realize this could be a pain to program...  anyway, WOW, looks great...

Quote
Oh yeah, and I also went ahead and improved the Reset Users option for good measure.


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

Not sure how you'd handle Looping before end of sequence, but I don't need it, not sure others would either... anyway - YOU ARE AMAZING, keep up the great work... and please do let us know when/how we can get the next release with the FOLLOWUP Sets?
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
At work on v1.85
« Reply #73 on: December 01, 2005, 09:08:21 am »
Quote
Yeah, that is great, when can the rest of us get our hands on it? That will save me a TON of time!

I provided it to my other client along with some custom SQL queries to create a field and a table.  First you'd need to update to v1.85 then I can send you the updated files. Drop me an email if you want it. :)
Quote
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?

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?)
Quote
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

I agree that this should be an option and I will be implementing it very soon.  For the meantime, you can do the same thing like this:
http://listmailpro.com/forum/index.php?topic=232.0

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Followup Saved Sets - needs to allow insertion in the list..
« Reply #74 on: January 04, 2006, 03:17:22 pm »
Hi DW,

Regarding the 'save/load' set of followups and your quote:
Quote
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?)


This will not work for me, I've got sets that need to be loaded BEGINNING at a certain Followup, I suggest you provide a way to do that, and then move ALL the other Followups DOWN - after the inserted Set of folllowups...

Is that possible, coming in the next code release?
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)