Web and WordPress Development
(678) 694-1709 // Email Us

A Constant Contact “Case Study”

Yeah I put case study in quotes. Not sure if this really qualifies as an official case study, but definitely worth a post.

Recently did a quick job with a client to update some of their mailing lists.

In a nutshell they needed some custom data added for each contact. The data was created using an algorithm provided by the client, but relied on some unique information from each subscriber.

So the process in pseudocode:

  1. Connect to Constant Contact’s API
  2. Get all of the contacts in a specific list
  3. For each contact get some of their information such as the user id, email address, etc.
  4. Build a string based on this data
  5. Update the contact’s information in Constant contact with this new data

Simple process, but a nice challenge.

Here are a few fun facts I learned:

  • Constant Contact returns its contact data in paged lists. So you can’t just ask for all of the contacts in a specific list and get one result set. You have to ask for each page. Yay recursive-ness.
  • There are limits to how many characters you can put in a field. Since the url that got built didn’t really fit logically in any of the provided fields I decided to use the custom fields CC provides. Fun fact: you can only put 50 characters in each custom field.
  • From the sending side of things, Constant Contact only allows you to enter subscriber fields into an email if the email is XHTML. And you must have valid XHTML or no dice on even getting the email out of draft stage.

All in all it was a bit frustrating, but successful. Which adds up to a fun programming day. And I got this nice little code sample I can post for you guys which includes a PHP class provided by Constant Contact, and my own custom code to use that class to do stuff to subscribers in a list.

If you’re interested in the code you can check it out here: download Constant Contact Class and case use files

Leave a Reply

Latest Posts

Using the WordPress Editor

In case you haven’t seen this, or are new to WordPress altogether, here’s a handly little primer on the WordPress WYSIWYG editor: http://en.support.wordpress.com/visual-editor/

Most of it is pretty common sense, but there are some nice hidden gems in there such as special characters, and a handy copy/paste feature especially if you’re working in MS Word

How to build a widget

In MBA school you explore a lot of theory and eventually try to apply that to actual practice. But theory comes first in academia, so theorize we did. And when you have to zoom so far out to make such broad brush strokes you need a common business model or product. In our case it was the widget. [More]

Paper Canopy is a Web development shop specializing in Web development, database development, application development and WordPress integration. We're not designers. We're coders with a design eye. We code XHTML/CSS, Javascript, PHP, Classic ASP, MySql, MSSQL, Access, and .NET. Learn more about us >>