Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Home

jordanbrock edited this page · 3 revisions
Clone this wiki locally

CampaignMonitor

A wrapper class to access the Campaign Monitor API. Written using the wonderful Flickr interface by Scott Raymond as a guide on how to access remote web services

Bugtracking

http://jordanbrock.lighthouseapp.com/projects/13212

Author: Jordan Brock <jordanbrock@gmail.com>
Copyright: Copyright © 2008 Jordan Brock <jordanbrock@gmail.com>
License: MIT <www.opensource.org/licenses/mit-license.php>

USAGE:

  require 'campaign_monitor'

  cm = CampaignMonitor.new(API_KEY)     # creates a CampaignMonitor object Can set CAMPAIGN_MONITOR_API_KEY in environment.rb

  cm.clients                            # Returns an array of clients associated with the user account
  cm.campaigns(client_id)
  cm.lists(client_id)
  cm.add_subscriber(list_id, email, name)

 CLIENT
  client = Client.new(client_id)
  client.lists
  client.campaigns

 LIST
  list = List.new(list_id)
  list.add_subscriber(email, name)
  list.remove_subscriber(email)
  list.active_subscribers(date)
  list.unsubscribed(date)
  list.bounced(date)

 CAMPAIGN
  campaign = Campaign.new(campaign_id)
  campaign.clicks
  campaign.opens
  campaign.bounces
  campaign.unsubscribes
  campaign.number_recipients
  campaign.number_clicks
  campaign.number_opens
  campaign.number_bounces
  campaign.number_unsubscribes

 SUBSCRIBER
  subscriber = Subscriber.new(email)
  subscriber.add(list_id)
  subscriber.unsubscribe(list_id)

 Data Types
  SubscriberBounce
  SubscriberClick
  SubscriberOpen
  SubscriberUnsubscribe
  Result

Something went wrong with that request. Please try again.