Author Topic: Repeating Messages and looping lists  (Read 5930 times)

rkamille

  • Posts: 2
    • View Profile
Repeating Messages and looping lists
« on: May 11, 2004, 09:14:47 am »
Hey Everyone!

First.. Dean.. I LOVE LISTMAILPRO!  Thank you!

Second,

I have a reminder email that I send out to a list every sunday evening.  I have poured over all the options and read all the docs and if it's there I missed it.  Is there a way to schedule a re-occuring email that happens at a given time to a given list?  (I read something about some new features in the next release that sounded like this)

Third,

I want to setup a list that 'repeats itself'.  Meaning it gets through the entire follow-up series and then starts over again at message # x (not necisarrily the first one).  

Are these options that are already built in and I am just to dense to have found them on my own?  Or are they not here... and if not any ideas on work arounds?

Thanks again for a fantastic peice of software offered at a fantastic value!

Raymond

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Repeating Messages and looping lists
« Reply #1 on: May 11, 2004, 02:05:32 pm »
Raymond,

Thank you for your kind comment and for your excellent questions.

Quote
I have a reminder email that I send out to a list every sunday evening. I have poured over all the options and read all the docs and if it's there I missed it. Is there a way to schedule a re-occuring email that happens at a given time to a given list? (I read something about some new features in the next release that sounded like this)

This is not currently possible from within the program, but it is possible with a custom addition.  The recent v1.77b update contains the following code at the end of dailymail:

  if(file_exists('./daily-xtra.php')){
    include('./daily-xtra.php');
  }

So, if you wanted a message sent every Sunday what you could do is set up a daily-xtra.php script in your main Listmail folder that inserts a scheduled message on Saturday, like so:

Code: [Select]
<?php
// Check if it's Saturday with the PHP date() function
if(date("l")=='Saturday'){
  
$list '1';
  
$subject "My message subject";
  
$message "This is a test message to be sent every Sunday

Enter your message text, including codes, etc.  Escape \"double quotes\" with a backslash.

End of message"
;

  
$fdate '0000-00-00';  // date in the past, will be sent next dailymail
  
$html_msg='';
  
$files='';
  
$cmd "insert into $qtable (date,list,subject,message,htmessage,fattach) values('$fdate','$list','".addslashes($subject)."','".addslashes($message)."','".addslashes($html_msg)."','$files');";

  
mysql_query($cmd);
}
?>

The main downside to this approach is it is difficult to modify the message you would like sent.  It will need to be entered in the PHP above, in the $message variable, with any double quotes "escaped" with backslashes, ie:  \" \".

Quote
I want to setup a list that 'repeats itself'. Meaning it gets through the entire follow-up series and then starts over again at message # x (not necessarily the first one).

This is also possible with the daily-xtra.php script with the following addition.  The example provides functionality to loop users at the end of a list (14) to be reset to the beginning.  It should be fairly straightforward how to modify this code to set users to be on another Sequence # instead of the first one when looping. (See: $firstfup variable)

Code: [Select]
<?php
// Start LOOP LIST 14

 // set list to move users from
 
$looplist '14';

 
// get last followup on the list
 
list($lastfup)=mysql_fetch_row(mysql_query("select seq from lm_follow where list = '$looplist' order by seq desc limit 1",$link));

 
// increment by one to match users who are the end of the sequence
 
$lastfup $lastfup 1;

 
// get first followup seq and delay
 
list($firstfup,$firstdel)=mysql_fetch_row(mysql_query("select seq,del from lm_follow where list = '$looplist' order by seq limit 1",$link));

 
// update users
 
mysql_query("update lm_users set cseq = '$firstfup', cdel = '$firstdel' where list = '$looplist' and cseq = '$lastfup'",$link);

// End LOOP LIST 14
?>

Hopefully you are  somewhat knowledgeable in PHP, otherwise this could be quite tricky for you! :-)

Good luck!
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

rkamille

  • Posts: 2
    • View Profile
WOW! Thank you for the very quick and detailed reply
« Reply #2 on: May 11, 2004, 09:44:05 pm »
Dean,

WOW! I was shocked to get your reply so quickly... and even more shocked at the detail in addressing my questions.  I think I am living in a dream world.

I am a rusty old Perl hand, and I can make my way around PHP with a little effort... with the code you included there isn't much left for me too do though ;).

Thank you again for a great product and even better support.  WAY beyond what I had ever expected.

Raymond

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
GREAT Support!
« Reply #3 on: May 12, 2004, 10:35:27 am »
Hi Dean,

I just wanted to chime in here!  Yes, your support is top notch and INCREDIBLE!  It is what made me decide to purchase, and continue to use ListMail Pro instead of all the others, and believe me I've tried ALL OF THE OTHERS.

Your support is top-notch, fast, and right on target.  Many other script authors are lousy at support, and even down right indignant when you ask them anything, not to mention the fact that most of the scripts they write are impossible to edit or make changes to.   It shows how respectable and well written your code is, and I appreciate it.

Thanks again for this great script and your great support with this new forum!
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

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