Ruby gem for accessing the Campaign Monitor API
Ruby
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 29 commits ahead, 67 commits behind jordanbrock:master.
carview.php?tsp= Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
carview.php?tsp= lib
carview.php?tsp= support/faster-xml-simple
carview.php?tsp= test
carview.php?tsp= .gitignore
carview.php?tsp= MIT-LICENSE
carview.php?tsp= README.rdoc
carview.php?tsp= Rakefile
carview.php?tsp= campaign_monitor.gemspec
carview.php?tsp= init.rb
carview.php?tsp= install.rb

README.rdoc

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 https://app.campaignmonitor.com to https://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

gem install patientslikeme-campaign_monitor

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