The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Opting back in a contact on Do Not Mail list doesn't work.


Opting back in a contact on Do Not Mail list doesn't work.

I've attempted to set up our custom signup form ( to opt contacts back in who are on the Do Not Mail list, based on the API documentation here:


I've had no luck getting it to work. The user stays on the Do Not Mail list, and it sends them a Welcome email, instead of a Resubscribe confirmation.


Here is the code generating the XML being sent:


$postdata = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>
<entry xmlns="">';
if ($_POST['id'])	$postdata .= '
else	$postdata .= '
$postdata .= '
  <title type="text">Contact: '.$_POST['email'].'</title>
    <name>Constant Contact</name>
  <content type="application/vnd.ctct+xml">
    <Contact xmlns=""';
if ($_POST['id'])
	$postdata .= ' id="'.$_POST['id'].'"';
$postdata .= '>
foreach($idList as $list) {
        $postdata .= '
        <ContactList id="'.$list.'"></ContactList>'; }
$postdata .= '

 It sends OptInSource as ACTION_BY_CONTACT, and a list of lists based on the form.

Anything look wrong here that I need to change, that might fix our issue?



Re: Opting back in a contact on Do Not Mail list doesn't work.



What response code is being passed back?  Is it successful or is it return an error code?

Ryan Davis
Quality Engineer
Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More