Quick Tip: WordPress and Campaign Monitor

A quick and simple way to integrate your Campaign Monitor list with WordPress.

Add a subscribe form to your site

The easiest way is to use the WordPress text widget and paste the Campaign Monitor form code into it. To generate a form, go to your list in Campaign Monitor and click Grow your audience. Next, click Copy/paste a form to your site.

Select the list or lists you want, then click Generate code. This will give you the form code to place in your site. You can later customize settings such as the confirmation message, thank-you note, and other options.

Email subscribers

When this post was first written, the automation functionality in Campaign Monitor was not yet available. Since then, automation has become the suggested way to integrate with WordPress. It uses Campaign Monitor directly and avoids adding extra bulk to your theme files and site.

Campaign Monitor automation

Campaign Monitor automation can read and parse RSS feeds. First, make sure to add the RSS to Email tags to your template, and create your list as you normally would.

Next, follow Campaign Monitor’s guide for email automation using the list and template mentioned above.

That’s it.

If you do not have an RSS or Atom feed

Add the Campaign Monitor Wrapper for PHP to your theme directory so you can access the functionality. Next, use the “create a draft campaign” and “send a draft campaign” features to send an email.

This code would go in your functions.php file, for example:

// be sure to require once the API wrapper.
function email_alert() {
    //campaign monitor code
}
add_filter ( 'publish_post', 'email_alert' );

Integrating with other languages and systems

For the most part, the steps would be similar. You may just need to choose a different API wrapper for v3 depending on the language you are using, especially if you are not working with an Atom or RSS feed.

Resources