Confirm Unsubscribe using API?

Hi,

I've not looked up the specifics of the API (so my code below is Pseudo-Code to explain the flow), but is it possible to generate a dynamic link in my email that runs a page on my own site that can then communicate with the API to unsubscribe a user eg something like..

TEMPLATE: To unsubscribe please visit mysite.com/unsubscribe/<campaignid>/<userid>

=> EMAIL: please visit... mysite.com/unsubscribe/39583/3905

=> PHP: $campaignid=39583; $userid=3905

Enter Your Email Address: [_______________] => $email

$CM_API_email = $CM_API.getEmailAddress($campaignid,$userid);
if($CM_API_email == $_POST["email"])
{
  $CM_API.unsubscribe($campaignid,$userid);
}

etc

thanks
j

jmp909, 9 years ago

or could i put my own [recipientid] field in my database and use that to look them up in the subscriber list with the API?

Mathew Mathew, 9 years ago

Hey J,

Is there a reason you can't just use the existing API methods to get back a list of people who have unsubscribed from your email? http://www.campaignmonitor.com/api/Campaign.GetUnsubscribes.aspx

You could also just pass through the email address to your page on the unsubscribe confirmation URL as described here: http://www.campaignmonitor.com/blog/archives/2007/08/capturing_unsubscribes_in_your.html


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor

See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free