public
Fork of jordanbrock/campaign-monitor-ruby
Description: Ruby gem for accessing the Campaign Monitor API with support for new API keys, hex IDs, and custom subscriber fields.
Homepage: http://github.com/patientslikeme/campaign_monitor/wikis
Clone URL: git://github.com/patientslikeme/campaign_monitor.git
jeremyw (author)
Fri Jan 23 12:44:00 -0800 2009
commit  474688fd2ff8ae5ee252984948f1ec31b5ee8a2e
tree    c44b7cf31b3dcb68ce3ca5f6ac98fe023bead102
parent  d64b4fea7c5a150b1e9cd98c64d8b799a825cb86
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 Wed Jan 07 11:39:32 -0800 2009 Updated readme [jeremyw]
file Rakefile Tue Aug 12 07:10:36 -0700 2008 Fix install task [Empact]
file campaign_monitor.gemspec Fri Jan 23 12:44:00 -0800 2009 Fixed adding subscribers with custom fields [jeremyw]
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/ Loading commit data...
directory support/ Sat Aug 23 16:41:21 -0700 2008 use libxml-ruby if possible [shenie]
directory test/ Tue Jan 06 21:16:44 -0800 2009 removed dependency on ActiveSupport, added a fe... [jeremyw]
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 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

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