3rd Party email marketing services like Constant Contact, Mail Chimp, iContact, Benchmark Email, Campaigner, just to name a few are the the increasingly popular solution for managing website newsletters and email campaigns. However I was unsatisfied with the pre-generated contact forms provided by these companies. You know the forms where you enter your email and are then redirected to the 3rd party's site to confirm your email address before being added to the list. Anyway I wanted to write an article talking up the benefits of using an API (if available), rather than the standard pre-generated forms. This article will deal with Constant Contact's API.
The Standard Constant Contact Form
When customers submit the standard constant contact form the following paramaters are passed to constant contact:
- ea = Email Field
- m = CC Account Number
When this form is submitted the customer is taken to away from the website to another form within a popup window. Additional information can be collected by adding fields to the form through constant contact. However there is no way of passing the information from the form on your website to the form on constant contact when the user submits there information.. So the solution to more customized constant contact forms is to use their API. You can get to the sample forms and code from the constant contact developer website or download them straight from sourceforge at this link http://sourceforge.net/projects/ctctsampleforms/.
The sample code includes a class to work with the API in a file called cc_class.php. The file contains the class CC_Utility() with 3 extensions to the class CC_List(), CC_Contact(), CC_Campaign(). This is where you put your cc account information:
var $login = 'cc-account-username'; //Username for your account
var $password = 'cc-account-password'; //Password for your account
var $apikey = 'your-api-key'; // API Key for your account.
Once you have your cc account information in the right place the class and API are very easy to work with, and provide the ability for you to setup a completely custom signup form on your website that interacts directly with your constant contact account. You can specify which email lists you want people to sign up for, allow customers to edit/update their contact information, and more. Best of all the customer will never leave your website, maintaining a professional appearance, and a more user-friendly process for your customers.