Ruby gem for accessing the Campaign Monitor API with support for new API keys, hex IDs, and custom subscriber fields.
#3 Compare This branch is 1 commit ahead, 39 commits behind jordanbrock:master.
Latest commit abb0cf3 Apr 25, 2009 jeremyw Improvements to readme
Failed to load latest commit information.
lib Fixed adding subscribers with custom fields Jan 23, 2009
support/faster-xml-simple use libxml-ruby if possible Aug 23, 2008
test removed dependency on ActiveSupport, added a few basic unit tests Jan 7, 2009
.gitignore Rather than keep the docs under source control, which doesn't make mu… Aug 12, 2008
MIT-LICENSE Moved directories Jun 23, 2008
README.rdoc Improvements to readme Apr 25, 2009
Rakefile Fix install task Aug 12, 2008
init.rb Moved directories Jun 23, 2008
install.rb Moved directories Jun 23, 2008



This RubyGem provides access to the Campaign Monitor API (

Campaign Monitor recently made some changes to their API.

This fork makes the following changes:

  • host changed from to

  • ID values are no longer sent #to_i because they are hex strings

  • added support for subscribers with custom fields using SOAP API

  • refactored gemspec to build on github

  • misc. cleanup and refactoring


An account with Campaign Monitor and the API Key. Accounts are free and can be created at



sudo gem install patientslikeme-campaign_monitor -s

Add the following to the Rails::Initializer block in config/environment.rb (optionally specify a :version):

config.gem 'patientslikeme-campaign_monitor', :lib => 'campaign_monitor', :source => ''

Git Repository


cm = # assumes you've set CAMPAIGN_MONITOR_API_KEY in your project

for client in cm.clients
  for list in client.lists # => returns the name

    # modify a subscriber list
    list.add_subscriber(email, name, custom_fields_hash)
    list.add_and_resubscribe(email, name, custom_fields_hash)

    # get subscriber list details
    subscribers = list.active_subscribers(since_time)
    unsubscribed = list.unsubscribed(since_time)
    bounced = list.bounced(since_time)

  for campaign in client.campaigns