We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

changing between active, non active, etc, via php api

danp459
Regular Participant

changing between active, non active, etc, via php api

is it not possible to change a contact back to active after do not mail?  My customer profile has a checkbox, 'add me to mail list'  Aparently, i cant put a person back on the active list?  I dont mind deleting the person completely if they uncheck the box, if i can put them back on in the future.

5 REPLIES 5
Mark-C
Member

Hello,

 

This is definitely possible through the API (see here). For contacts who have opted out from all of your mailings, which are added to the system list called Do Not Mail for the account, opting back in must be done by the contact themselves.  When using the API, this means they must use a form, and that the XML submitted when they opt themselves back in must include an <OptInSource> element whose contact is ACTION_BY_CONTACT.  In some cases, you may need to add this element into the XML that is being submitted with the PUT method request to update the contacts details to put them back onto one or more Active contact lists.

 

I hope this is helpful to you.  Let us know if you have any additional questions.

 

Cheers,

Mark Coleman
Support Engineer
danp459
Regular Participant

that must have been it as i was not changing the $asctionby property.  ok, so

$oConstantContact->actionBy = 'ACTION_BY_CONTACT';

should set that property and then
createContactXML(null, array('status'=>'Active','email'=>'asdf@asdf.com')

should get my xml (along with list, name, etc)

what are the options for status?

 

I'm using

* @author ConstantContact Dev Team
    * @version 2.0.0
    * @since 30.03.2010
is that old?  seems like the things you have in git are quite different.

We have updated the wrapper many times since 2010, which was when we originally released the PHP wrapper.  Git does have the latest version.  I recommend making sure you use the latest commit to Git.

 

The status field is a read only field.  The possible values are: removed, active, do not mail, unconfirmed.  You can find them on our documnetation page here: http://community.constantcontact.com/t5/Documentation/Contacts-Collection-and-Resource/ba-p/25989.  Since this is a read only field, the value you pass to us won't matter.  We'll automatically change the status to the correct state if the status needs to be changed.  For example, you can update contact information for a contact who is unconfirmed and change their list memberships.  However, if they don't click the confirmation link in the confirmed opt in email (provided confirmed opt in is on), they will remain in unconfirmed since they haven't clicked the confirmation link. 

Dave Berard
Senior Product Manager, Constant Contact
danp459
Regular Participant

wait, what? I have added and removed plenty of emails with no confirmation. doing the get_subxcribers() tells me that i have active contacts or do not mail contacts, etc.  Furthermore, how could you possibly know if it 'needs to be changed'? 

Sorry for the confusion.  The Confirmation is an optional feature we have that can be enabled/disabled within the account.  It allows any customer of ours to required double opt in, which uses a confirmation email to confirm membership and changes.  This is turned OFF by default for all accounts.

 

The status change reflects the attributes of a contact.  Here's what a status means and how we decide what status to provide:

 

Active - Subscriber is an active, current member of one or more Contact Lists

Removed - Subscriber is not a current member of at least one Contact List but has not requested to be unsubscribed

Do Not Mail - Suscriber (or API integration) has requested to be opted out of all mailing lists

 

Unconfirmed (optional via Confirmed Opt In feature) - Subscriber has requested to be added to a mailing list but has not clicked the Confirm link in the Confirmation email which was sent to them. 

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

View API documentation, code samples, get your API key.

Visit Page