cancel
Showing results for 
Search instead for 
Did you mean: 

Through php code how to unsubscribe a single user from a single list

SOLVED
Occasional Advisor

Through php code how to unsubscribe a single user from a single list

Through PHP API they made availble m not able to find a api through which i can unsubsribe a particular user from the particular list

7 REPLIES 7
Highlighted
Trusted Contributor

Re: Through php code how to unsubscribe a single user from a single list

Hello,

 

I assume you are referring to our PHP Wrapper Library.  Regardless, in our data model, interest/lists are attributes of the contact, so to unsubscribe a contact from a single list, you would need a to make up to three API calls, depending on whether you already have the contact details including the contacts ID on hand for your application's use.

 

The flow would be something like this:

 

1) Search for the contact by email address (makes a GET request specifying an email address).

2) If a contact with this email address is found, use the returned ID to retrieve the contact's information (GET request that returns full details for the contact, including current ContactLists attributes for the contact).

3) Remove just the list you wish to unsubscribe the contact from from the the contactlists that are returned in the contact object, and then update the contact (makes a PUT request to update the contact, which will replace current contact details with the new modified details.

 

I hope this helps. Let us know if you have additional questions.

Mark Coleman
Support Engineer
Occasional Advisor

Re: Through php code how to unsubscribe a single user from a single list

Hi mark,

 

Thanks for you reply, you process seems right.

Let me clear my question more clearly.

In a camapign Email their is option to Safeunsubscribe from the mailing list if user click on this he will be complete removed from the mailing list(All lists). But i want to remove him from particular mailing list.

CTCT Employee

Re: Through php code how to unsubscribe a single user from a single list

Hi,

 

If I am understanding you correctly, you want to make sure the person who receives the email can unsubscribe from any given list that they are on, instead of unsubscribing from all lists.

 

To make sure they have this option, you will want to make sure that you make any given list that you want somebody to be able to unsubscribe from visible.  You can modify list properties to make them visible by following the steps in this link.

 

I hope that helps!  Thank you for contacting Constant Contact, and have a wonderful day!

 

Best Regards,

Shannon W.

API Support Specialist

Occasional Advisor

Re: Through php code how to unsubscribe a single user from a single list

Hi,

 

This is not we required, 

Suppose I am having two list, list-1 and list-2.

And a user (ex. testingteam@gmail.com) is in both list-1 and list-2. Now a Email campaign is send to list-1 users.

-User testingteam@gmail.com open his campaign and click on unsubscribe link. According to my research he will be removed from both list-1 and list-2, but what I want is if he should be removed from the list-1 only. he remain subscribed for the list-2.

Occasional Advisor

Re: Through php code how to unsubscribe a single user from a single list

Please let me know if you are still confused with my question.

CTCT Employee

Re: Through php code how to unsubscribe a single user from a single list

Hi,

 

I do believe we are talking about the same thing.  You want a user to click on the unsubscribe button and have the option to stay on any given list, correct?

 

If you make both lists visible to your users, they can click on the unsubscribe link on any email sent from the account, and the page they go to will show them the lists that are visible in the Constant Contact account.  They can remove themself from one list or the other, without having to be removed from both.  They can also unsubscribe from the account entirely.  

 

If you have two visible lists, and mail to your subscriber, they will click unsubscribe and see something along the lines of this: http://screencast.com/t/AAmlLqLmzkWv where your visible list names appear on the page for people to stay on or unsubscribe from.

 

Please let me know if I misunderstood you, and if you have any follow up questions.

 

Best Regards,

Shannon W.

API Support Specialist

Occasional Advisor

Re: Through php code how to unsubscribe a single user from a single list

Thank you shannon this is what we required.