Between 8:00 - 9:00 am ET on 10/25 we need to take our site down to make updates. We recommend logging out before 8:00am ET and not using your account during this time. Thank you for your patience while we make these important updates.

is it possible to return true or false for email check?

SOLVED
Go to solution
Regular Participant

is it possible to return true or false for email check?

I'm trying to wrap my head around the CC api in relation to checking an email address against a list, but I cannot for the life of me figure it out. Is it possible to return a simple true or false when submitting an email address in a form?

 

I've read this: http://community.constantcontact.com/t5/Documentation/Searching-for-a-Contact-by-Email-Address/ba-p/... but it has no actual implementation examples. Here's the code I've been trying, but it is not working.

 

include_once('cc_class.php');

 

$ccContactOBJ = new CC_Contact("basic", $cckey, $ccuser, $ccpass);


//if we have post fields means that the form have been submitted.
if(($_SERVER['REQUEST_METHOD']=="POST") && !empty($_REQUEST['member-submit'])) {
$contact = $ccContactOBJ->getSubscribers(urlencode($_POST['MemberEmail']));
if (empty($contact['items'])) {
$message = 'You have been added to our database.';
echo $message;
}
else {
$message = 'You are already listed in our database';
echo $message;
}
}

1 ACCEPTED SOLUTION

Thank you for the file,

 

I just reviewed it and found the login variable missing an 'e' in the name of the account.  After adding that in, I was able to make successful requests to our API.  

 

Please confirm this as a solution after you've tested.

 

Thanks,

Andrew Weber
Associate Product Manager for EventSpot

View solution in original post

15 REPLIES 15
Developer Portal

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

Visit Page