Class: ExpressPigeon::AutoResponders

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/express_pigeon/auto_responders.rb

Overview

AutoResponders

Instance Method Summary collapse

Instance Method Details

#indexObject

Get all autoresponders

GET api.expresspigeon.com/auto_responders



10
11
12
# File 'lib/express_pigeon/auto_responders.rb', line 10

def index
  self.class.get('')
end

#report(auto_responder_id) ⇒ Object

Report for a single autoresponder

GET api.expresspigeon.com/auto_responders/auto_responder_id



45
46
47
# File 'lib/express_pigeon/auto_responders.rb', line 45

def report(auto_responder_id)
  self.class.get("/#{auto_responder_id}")
end

#report_bounced(auto_responder_id, auto_responder_part_id) ⇒ Object

Get bounced contacts for autoresponder part

GET api.expresspigeon.com/auto_responders/auto_responder_id /auto_responder_part_id/bounced



52
53
54
# File 'lib/express_pigeon/auto_responders.rb', line 52

def report_bounced(auto_responder_id, auto_responder_part_id)
  self.class.get("/#{auto_responder_id}/#{auto_responder_part_id}/bounced")
end

#report_spam(auto_responder_id, auto_responder_part_id) ⇒ Object

Get spam contacts for autoresponder part

GET api.expresspigeon.com/auto_responders/auto_responder_id /auto_responder_part_id/spam



66
67
68
# File 'lib/express_pigeon/auto_responders.rb', line 66

def report_spam(auto_responder_id, auto_responder_part_id)
  self.class.get("/#{auto_responder_id}/#{auto_responder_part_id}/spam")
end

#report_unsubscribed(auto_responder_id, auto_responder_part_id) ⇒ Object

Get unsubscribed contacts for autoresponder part

GET api.expresspigeon.com/auto_responders/auto_responder_id /auto_responder_part_id/unsubscribed



59
60
61
# File 'lib/express_pigeon/auto_responders.rb', line 59

def report_unsubscribed(auto_responder_id, auto_responder_part_id)
  self.class.get("/#{auto_responder_id}/#{auto_responder_part_id}/unsubscribed")
end

#start(auto_responder_id, email_address) ⇒ Object

Start for a contact

POST api.expresspigeon.com/auto_responders/auto_responder_id/start



17
18
19
20
21
22
23
24
25
26
# File 'lib/express_pigeon/auto_responders.rb', line 17

def start(auto_responder_id, email_address)
  options = {}
  options['email'] = email_address

  self.class.post(
    "/#{auto_responder_id}/start",
    body: options.to_json,
    headers: { 'Content-Type' => 'application/json' }
  )
end

#stop(auto_responder_id, email_address) ⇒ Object

Stop for a contact

POST api.expresspigeon.com/auto_responders/auto_responder_id/stop



31
32
33
34
35
36
37
38
39
40
# File 'lib/express_pigeon/auto_responders.rb', line 31

def stop(auto_responder_id, email_address)
  options = {}
  options['email'] = email_address

  self.class.post(
    "/#{auto_responder_id}/stop",
    body: options.to_json,
    headers: { 'Content-Type' => 'application/json' }
  )
end