Hi
I am using the PHP samples and have integrated them into our website and have noticed two things:
Please let me know what you need from me to assist. Thank you!
Steve
Are add_contact or edit_contact actually adding and updating the contact, or are you receiving an error message? I just did some testing with a number of operations using our API and have not seen any slow response times.
Regarding forcing the form to display your lists in a certain order, the sample forms show your contact lists displayed in the order they were retrieved from the server, which is in the order that they were created. However you do have two options for customizing which lists are going to be displayed:
1- You could use the contact list options included at the top of cc_class to specify which lists will or will not be available for sign up, but this does not modify the order in which the lists are displayed. This would consist of modifying $doNotIncludeLists (line 35) or $contact_lists (line 18) variables.
2- Our API does return a <SortOrder> node with a GET on the lists collection (https://api.constantcontact.com/ws/customers/{user-name}/lists) which you could use to display the lists in a specified order. This is the node that our user interface at www.constantcontact.com uses to change the order in which lists are displayed. Unfortunately this functionality is not built into our PHP sample pack at this time.
David J
I am basically trying to use the appropriate form based on whether the user is or isn't a current contact--logically, it is opening up the lists the user is subscribed to (if they are a contact) and allows them to modify their selections.
I include the class and check to see if the email address loaded into the current login session is in the constant contact DB:
include_once($v3Path."/includes/classes/ConstantContact/cc_class.php");
$ccOBJ = new ConstantContact();
$is_contact=NULL;
if (!empty($_SESSION)) {
$contact = $ccOBJ->getSubscribers(urlencode($_SESSION));
if (empty($contact) || empty($_SESSION)) {
$is_contact = false;
//header('Location: simple_form.php?email='.urlencode($_POST));
}
else {
$is_contact = true;
//header('Location: edit_contact.php?email='.urlencode($_POST));
}
}
Then, I'm including the add_contact or edit_contact (named add_my_contact.php and edit_my_contact.php, respectively, for use in the "My Subscriptions" portal on our site) based on the boolean value of $is_contact.
if($is_contact) { ?>
<p>The email address <strong><?php echo $_SESSION; ?></strong> has been located in our mailing lists. Below is a listing of the current e-newletters that you receive. To add your email address to another list, please check the box next to the e-newsletter you would like to subscribe to. To remove your email address from a particular e-newsletter, simply uncheck the box next to the corresponding e-newsletter.</p>
<?php include($v3Path."/includes/classes/ConstantContact/edit_my_contact.php");
} else { ?>
<p>Would you like to receive e-newsletters from AAA that contain valuable information and enticing special deals? Sign up below by choosing which e-newsletters you would like to receive from the list.<br />
<span class="small em">Our records indicate your email address is <strong><?php echo $_SESSION; ?></strong>. Your email address has been pre-populated using your account profile information. If you would like to receive these e-newsletters through a different email address, you must <a href="<?php echo $v3linkURL; ?>/portal/Account/Profile">update your AAA.com Account with the new address</a>.</span></p>
<?php include($v3Path."/includes/classes/ConstantContact/add_my_contact.php");
}
The holidays have come and gone. For many seasonal businesses, this means the rush of shoppers has decreased as well. Instead of turning off the lights and waiting for spring, make your email marketi...
See Article