Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby gem for accessing the Campaign Monitor API with support for new API keys, hex IDs, and custom subscriber fields.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 support
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 TODO
Octocat-spinner-32 campaign_monitor.gemspec
Octocat-spinner-32 init.rb
Octocat-spinner-32 install.rb


This RubyGem provides access to the Campaign Monitor API (

Campaign Monitor recently made some changes to their API.

patientslikeme's 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

This fork integrates the following additional changes:

* updates Subscriber#is_subscribed? to work with the latest API. (from amiel)
* adds support for array values in custom_field_hash (from oferlin)
* API key cleanup (from yyyc514)
* added ability to get fetch lists by id using List#GetDetails or List#[] (from yyyc514)
* added support for adding and deleting clients (from yyyc514)
* added support for querying CM for countries and timezones (from yyyc514)
* added support for creating campaigns (from yyyc514)
* general test and api cleanup (from yyyc514)


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



gem install patientslikeme-campaign_monitor

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

Something went wrong with that request. Please try again.