jordanbrock / campaign-monitor-ruby

Ruby gem for accessing the Campaign Monitor API

This URL has Read+Write access

name age message
file .gitignore Tue Aug 12 07:10:35 -0700 2008 Rather than keep the docs under source control,... [Empact]
file MIT-LICENSE Sun Jun 22 20:34:50 -0700 2008 Moved directories [jordanbrock]
file README.rdoc Sun Apr 19 00:03:03 -0700 2009 Updating readme and gemspec [Reid Beels]
file Rakefile Fri Feb 20 18:21:35 -0800 2009 clean up docs and add invalidkey error that's r... [Josh Goebel]
file TODO Thu Feb 26 04:26:03 -0800 2009 make lists and array and rip out misc classes i... [Josh Goebel]
file campaign_monitor.gemspec Sun Apr 19 00:03:03 -0700 2009 Updating readme and gemspec [Reid Beels]
file init.rb Sun Jun 22 20:34:50 -0700 2008 Moved directories [jordanbrock]
file install.rb Sun Jun 22 20:34:50 -0700 2008 Moved directories [jordanbrock]
directory lib/ Tue Sep 29 20:05:29 -0700 2009 Allowing user to unsubscribe from a list [jonathan]
directory support/ Fri Feb 20 17:39:35 -0800 2009 clean up rdoc [Josh Goebel]
directory test/ Thu Feb 26 05:32:00 -0800 2009 remove dup lines and puts [Josh Goebel]
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.

patientslikeme’s fork makes the following changes:

    * host changed from http://app.campaignmonitor.com to http://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

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)

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