Author Topic: Loop users in a followup sequence  (Read 5080 times)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Loop users in a followup sequence
« on: August 03, 2004, 04:51:28 am »
This script is redundant as of ListMail v1.86 when it was added as an option on the List Settings page.
-----
This is possible with a custom script that runs after dailymail simply by adding the file "daily-xtra.php" to your main ListMail folder (v1.77b)

In this file, place the following: (example for list 14)

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 */
?>
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

AlanT

  • Posts: 47
    • View Profile
    • http://www.PowerKeysPub.com
Loop users in a followup sequence
« Reply #1 on: September 25, 2004, 10:09:31 am »
It looks like this kind of script can also move a subscriber from one list to another list after the first sequence is finished.  Am I right on this?

I'd like to be able to have my broadcasts go out to only those users who have finished the basic followup sequence (to avoid annoying anyone with 'excessive' marketing), and the easiest way would be to have the subscribers of the basic sequence moved to a 'broadcast list'.

Just to make sure I understand what to do here, it looks like I would use the daily-xtra.php script to do a MySQL update on all subscribers to list #1 (the basic sequence), last followup, and edit them to be the first followup on the broadcast list (list #2).

So, here is the edited code as I have it:

Code: [Select]
<?php 
/* Start Switch List */ 

 // set list to move users from 
 
$oldlist'1'
 
$newlist'2';

 
// get last followup on the list  
list($lastfup)=mysql_fetch_row(mysql_query("select seq from lm_follow where list = '$oldlist' 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 = '$newlist' order by seq limit 1",$link)); 

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

/* End Switch List */ 
?>


Do I have it edited correctly?

- Alan
- 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
Loop users in a followup sequence
« Reply #2 on: October 01, 2004, 03:51:58 pm »
Yes, this appears correct!
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

alice

  • Posts: 10
    • View Profile
Loop users in a followup sequence
« Reply #3 on: February 22, 2005, 12:41:02 am »
Hello I'm not quite sure I follow how to implement this. Do I add this code to the dailymail.php or put this code into a new file and name it daily-xtra.php and then set up a cron for it to run after dailymail runs? I tried doing the 2nd way and running the file straight from my browser and it gets errors.

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Loop users in a followup sequence
« Reply #4 on: February 22, 2005, 03:00:48 am »
Alice,

Paste the code into a file named daily-xtra.php and simply upload it to your ListMail folder.   ListMail's dailymail script will automatically detect and execute it.

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