No release in over 3 years
Low commit activity in last 3 years
A simple wrapper class that provides basic access to the Campaign Monitor API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.5.8
>= 1.0.11
 Project Readme

campaign_monitor¶ ↑

This RubyGem provides access to the Campaign Monitor API (www.campaignmonitor.com/api).

Campaign Monitor recently made some changes to their API.

This fork makes the following changes:

  • host changed from app.campaignmonitor.com to api.createsend.com

  • 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

Pre-requisites¶ ↑

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

Resources¶ ↑

Install¶ ↑

sudo gem install patientslikeme-campaign_monitor -s http://gems.github.com

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 => 'http://gems.github.com'

Git Repository¶ ↑

github.com/patientslikeme/campaign_monitor

Usage¶ ↑

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

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

    # modify a subscriber list
    list.add_subscriber(email, name, custom_fields_hash)
    list.remove_subscriber(email)
    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)
  end

  for campaign in client.campaigns

  end
end