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

scottscomp

  • I'm new here
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Which file processes the remove links
« on: July 01, 2008, 12: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

  • I've been sending email for awhile
  • ****
  • Posts: 203
  • Karma: +0/-0
    • View Profile
Which file processes the remove links
« Reply #1 on: July 02, 2008, 08:10:50 AM »
I believe the file is "rem.php".

Hope that helps.

DW

  • Administrator
  • I know email inside out
  • *****
  • Posts: 3713
  • Karma: +33/-0
    • View Profile
    • http://listmailpro.com
Which file processes the remove links
« Reply #2 on: July 02, 2008, 01: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://forum.listmailpro.com/viewtopic.php?t=1160

Regards
ListMailPRO Author & Developer - Help | Support | Hosting

scottscomp

  • I'm new here
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Which file processes the remove links
« Reply #3 on: July 22, 2008, 06: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

  • I'm new here
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Which file processes the remove links
« Reply #4 on: July 22, 2008, 07: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