Developer & API Support
Reply
Frequent Visitor
Posts: 3
Registered: ‎03-30-2012

Add One Subscriber to Multiple Lists via One Form

[ Edited ]

How would I go about having checkboxes for 5 different mailing lists in the same constant contact form? This way we can have one form and users would select 1,2,3,4 or all mailing lists.

i.e.

Select mailing lists you want to subscribe to
[x] mailing list 1
[ ] mailing list 2
[x] mailing list 3
[ ] mailing list 4
[ ] mailing list 5

I would most like to do this with Contant Contact Wordpress Plugin or Gravity Forms + Constant Contact Wordpress plugin, but I figure I need to understand how others have added one email form submission to multiple mailing lists at the same time.  Some of my searches seem to point to problems with signing up someone for multiple account if they are already subscribed to at least one (returning a "Sorry, you're already subscribed" message).

 

Appreciate any insight, thanks!

Posts: 162
Kudos: 13
Solutions: 9
Registered: ‎04-20-2011

Re: Add One Subscriber to Multiple Lists via One Form

Hey Bruce,

 

Most of the signup forms provided for us online return this type of message on purpose. The signup forms will attempt to create a brand new contact, so if the contact already exists on any other lists, a 409 conflict message is returned and the contact is not created. It is completely possible to update the contact if the 409 error is returned, but the problem lies in the security of that form. If the form is open for modification like that, anyone could essentially change anyone else's profile in your system. This may not be an immediate concern for many people, but the possibility still exists, so it's usually better to err on the side of caution.

 

Unfortunately, I won't be able to give you any direct modifications to any of the 3rd party Wordpress plugins. I would suggest reaching out to those developers directly for assistance with that. I can give you the logic of the contact flow that can be used for this, though.

 

flow.png

 

Notice how if you update the contact, you need to grab the existing contact details before pushing the new information in, or else the contact will be overwritten with blank information and be removed from all other lists they may be on.

 

I hope this helps, please let me know if you have any questions.

Nick Galbraith
Support Engineer
Frequent Visitor
Posts: 3
Registered: ‎03-30-2012

Re: Add One Subscriber to Multiple Lists via One Form

Thank you for the reply.  Your flow-chart is helpful.

 

Has anyone actually implemented this on the development side? It would be great to see a working example.  I would expect other Constant Contact users would want to offer subscribers subscriptions to different lists. 

 

The way the form would ideally work is you send requests to subscribe to multiple mailing lists, and if one is already subscribed, it will fail automatically but the other subscriptions would persist.

 

Anyway, any examples or direction on how others have made this happen would be appreciated, thanks!

 

 

Posts: 162
Kudos: 13
Solutions: 9
Registered: ‎04-20-2011

Re: Add One Subscriber to Multiple Lists via One Form

If you were to use our PHP Wrapper Library, there's actually a few functions built in that would make this easier than modifying an existing application. This would be some of the code to use.

 

<?php  
// Search for a contact by Email Address
$search = $ConstantContact->searchContactsByEmail('example@example.com');

if(empty($search)) {
//Get potential contact lists
$lists = $ConstantContact->getLists();

$contactObj = new Contact();
$contactObj->lists = array($lists['lists'][0]->id, $lists['lists'][1]->id);
$contactObj->emailAddress = 'example@example.com';

// Create the contact
$Contact = $ConstantContact->addContact($contactObj);

}else{

// Get details for the Contact
$Contact = $ConstantContact->getContactDetails($search[0]);

// modify Contact properties
$Contact->firstName = "John";
$Contact->lastName = "Doe";

//update the contact
$Contact = $ConstantContact->updateContact($Contact);
}
?>

 You'll want to be careful when doing this type of call, however. There's no way to verify that the person entering in the email address is the actual owner of that address, so that opens up a small risk of list poisoning. Hope that helps!

Nick Galbraith
Support Engineer
Visitor
Posts: 2
Registered: ‎10-13-2011

Re: Add One Subscriber to Multiple Lists via One Form

I wonder if anyone has made a form for Constant Contact that will simultaneouly enter people on Twitter accounts?  

 

For instance, let's say I have a main list I want everyone that subscribes on like WA State.  Then people may choose different Cities that wish to receive info about optionally.  I would like the subscriber to be entered into the respective lists for CC and at the same time be entered onto Twitter.  What would make this even better is if they could be entered into SMS lists in the same manner with some type of "opt-in".

Moderator of www.yoliwa.com and www.werehavingablast.com, which are affiliated domains of www.timefreedom.com
Posts: 747
Topics: 12
Kudos: 53
Solutions: 42
Registered: ‎10-24-2011

Re: Add One Subscriber to Multiple Lists via One Form

Hi Robert,

 

You should have the capability to make your integration add a contact to any lists(s) in Constant Contact as well as do what you want in Twitter at the same time, but we haven't really explored SMS lists as a company.  We do one-off texts for individuals looking to be added to a Constant Contact account, but the owner of the account currently sets what list people go into (users can't self-select).

 

That's good feedback for us--thank you for the note.

 

Best Regards,

Shannon W.

API Support Specialist