Author Topic: Which file processes the remove links  (Read 4319 times)

scottscomp

  • Posts: 18
    • View Profile
Which file processes the remove links
« on: July 01, 2008, 01:04:49 pm »
Hey guys!

I am integrating my listmail pro with the amember membership system.  The only thing left to do is update the unsubscription link.

When I use !remove it automatically inserts the removal link.

What I need to do is insert this code:


if (preg_match('/"*(.*?)"*s*<(.+?)>s*$/', $email, $regs)){
$email_only = $regs[2];
} else
$email_only = $email;
$sign = substr(md5($email_only.'-AMEMBER'), 0, 4);
$link = "$config[root_url]/unsubscribe.php?e=$e&s=$sign";


Where $email is the subscribers email address, and it spits out the removal link as $link.

Subscribers are then sent to amember to unsubscribe, and amember makes sure they are also removed from listmailpro.

I just need to know which file "generates" the removal link so I can replace it with my code. :)

-Scott

mike2

  • Posts: 193
    • View Profile
Which file processes the remove links
« Reply #1 on: July 02, 2008, 09:10:50 am »
I believe the file is "rem.php".

Hope that helps.

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Which file processes the remove links
« Reply #2 on: July 02, 2008, 02:55:54 pm »
Since the addition of remove link code options an additional parameter and various styles of remove link were added.  There are a few ways to pass the user data:

1. Just the uid: "rem.php&u=ab123cd" which would mean no code options could be used and the remove confirm page is shown.
2. The code id and the uid: "rem.php?u=123,ab123cd" the set options are used (such as multi-list remove and one-click remove)
3. The code id, list and email: "rem.php?x=123,2,user@example.com" the options set in ListMail are used.

I recommend a cURL, fopen or file_get_contents() to the rem.php file to make things easy, as seen here:
http://listmailpro.com/forum/index.php?topic=1160.0

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

scottscomp

  • Posts: 18
    • View Profile
Which file processes the remove links
« Reply #3 on: July 22, 2008, 07:05:39 am »
I figured it out!

The removal link is generated on line 669 of admin.php.

I was able to remove the link generation code there and add my own, so when a user "unsubscribes", they are *actually* unsubscribing from amember.  When cron runs that night, amember will remove them from listmail.

scottscomp

  • Posts: 18
    • View Profile
Which file processes the remove links
« Reply #4 on: July 22, 2008, 08:07:56 am »
Just FYI, this is what I replaced it with:



 case 'remove' :
    $sign = substr(md5($email.'-AMEMBER'), 0, 4);
   $rlink = "http://www.forexconfidential.com/members/unsubscribe.php?e=$email&s=$sign";
   $rtext = "You can cease receiving further updates here:\n";
      
   if($mhtml=='1'){ $rtext .= "<br><a href=\"$rlink\">$rlink</a><br><br>"; } else { $rtext .= $rlink; }
        
   $xmsg = eregi_replace($keych . $ref,$rtext,$xmsg);
break;

So now when someone unsubscribes from a message we send in Listmail, they actually unsubscribe from the aMember list.  :)

-Scott