Unsubscribe Link How to Generate "S=xxxxxx" Unsubscribe Code

Discussion in 'Customization & add-ons' started by dbtechdesign, Mar 22, 2013.

  1. dbtechdesign

    dbtechdesign New Member

    Joined:
    Jan 7, 2013
    Messages:
    2
    Hi,

    I am using a custom way to send out emails to my group from amember, what i need to know is how to generate the "Unsubscribe" security string after the email address string in teh URL.

    When you click on the unsubscribe link in the email the last string ?s=ijsoidjow < this code here is what im trying to find out how to generate.

    I do not see it in the database anywhere so im guessing it is created or encrypted email ? It seems to be the same for every email address.

    Thanks!
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    This is better to include aMember API and use it to generate unsubscribe link. (you will have to query aMember's database ion any way in order to get site_key )
    Here is example:
    PHP:
    include "/amember/bootstrap.php";
    $link Am_Mail::getUnsubscribeLink($email_addressAm_Mail::LINK_USER);

Share This Page