class ExpressPigeon::Campaigns

Public Class Methods

new() click to toggle source
# File lib/expresspigeon-ruby/campaigns.rb, line 5
def initialize
  @endpoint = 'campaigns'
end

Public Instance Methods

all(params ={}) click to toggle source
# File lib/expresspigeon-ruby/campaigns.rb, line 9
def all (params ={})
  get @endpoint, params
end
bounced(campaign_id) click to toggle source
# File lib/expresspigeon-ruby/campaigns.rb, line 25
def bounced(campaign_id)
  get "#{@endpoint}/#{campaign_id}/bounced"
end
clicked(campaign_id) click to toggle source
# File lib/expresspigeon-ruby/campaigns.rb, line 21
def clicked(campaign_id)
  get "#{@endpoint}/#{campaign_id}/clicked"
end
delete(campaign_id) click to toggle source
# File lib/expresspigeon-ruby/campaigns.rb, line 68
def delete(campaign_id)
  del "#{@endpoint}/#{campaign_id}"
end
opened(campaign_id) click to toggle source
# File lib/expresspigeon-ruby/campaigns.rb, line 17
def opened(campaign_id)
  get "#{@endpoint}/#{campaign_id}/opened"
end
report(campaign_id) click to toggle source
# File lib/expresspigeon-ruby/campaigns.rb, line 13
def report(campaign_id)
  get "#{@endpoint}/#{campaign_id}"
end
schedule(params = {}) click to toggle source

Schedules a new campaign to be sent. Parameters:

  • list_id - id of list to send to

  • template_id - id of template to send

  • name - name of a newly created campaign

  • from_name - from name

  • reply_to - reply to

  • subject - subject of campaign

  • google_analytics - true to turn Google Analytics on

  • schedule_for - Specifies what time a campaign should be sent. If it is provided the campaign will

    be scheduled to this time, otherwise campaign is sent immediately. The schedule_for
    must be in ISO date format and should be in the future.
# File lib/expresspigeon-ruby/campaigns.rb, line 64
def schedule(params = {})
  post @endpoint, params
end
send(params = {}) click to toggle source

Schedules a new campaign to be sent. Parameters:

  • list_id - id of list to send to

  • template_id - id of template to send

  • name - name of a newly created campaign

  • from_name - from name

  • reply_to - reply to

  • subject - subject of campaign

  • google_analytics - true to turn Google Analytics on

# File lib/expresspigeon-ruby/campaigns.rb, line 47
def send(params = {})
  post @endpoint, params
end
spam(campaign_id) click to toggle source
# File lib/expresspigeon-ruby/campaigns.rb, line 33
def spam(campaign_id)
  get "#{@endpoint}/#{campaign_id}/spam"
end
unsubscribed(campaign_id) click to toggle source
# File lib/expresspigeon-ruby/campaigns.rb, line 29
def unsubscribed(campaign_id)
  get "#{@endpoint}/#{campaign_id}/unsubscribed"
end