Class: CreateSend::Journey

Inherits:
CreateSend show all
Defined in:
lib/createsend/journey.rb

Overview

Represents a journey and provides associated functionality

Constant Summary

Constants included from CreateSend

USER_AGENT_STRING, VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auth, journey_id) ⇒ Journey

Returns a new instance of Journey.



6
7
8
9
# File 'lib/createsend/journey.rb', line 6

def initialize(auth, journey_id)
  @journey_id = journey_id
  super
end

Instance Attribute Details

#journey_idObject (readonly)

Returns the value of attribute journey_id.



4
5
6
# File 'lib/createsend/journey.rb', line 4

def journey_id
  @journey_id
end

Instance Method Details

#email_bounces(email_id = "", date = "", page = 1, page_size = 1000, order_direction = 'asc') ⇒ Object

Gets a paged result of all bounces for a journey email



38
39
40
# File 'lib/createsend/journey.rb', line 38

def email_bounces(email_id="", date="", page=1, page_size=1000, order_direction='asc')
  paged_result_by_date("bounces", email_id, date, page, page_size, order_direction)
end

#email_clicks(email_id = "", date = "", page = 1, page_size = 1000, order_direction = 'asc') ⇒ Object

Gets a paged list of subscribers who clicked a given journey email



28
29
30
# File 'lib/createsend/journey.rb', line 28

def email_clicks(email_id="", date="", page=1, page_size=1000, order_direction='asc')
  paged_result_by_date("clicks", email_id, date, page, page_size, order_direction)
end

#email_opens(email_id = "", date = "", page = 1, page_size = 1000, order_direction = 'asc') ⇒ Object

Gets a paged list of subscribers who opened a given journey email



23
24
25
# File 'lib/createsend/journey.rb', line 23

def email_opens(email_id="", date="", page=1, page_size=1000, order_direction='asc')
  paged_result_by_date("opens", email_id, date, page, page_size, order_direction)
end

#email_recipients(email_id = "", date = "", page = 1, page_size = 1000, order_direction = 'asc') ⇒ Object

Gets a list of all recipients of a particular email within a journey



18
19
20
# File 'lib/createsend/journey.rb', line 18

def email_recipients(email_id="", date="", page=1, page_size=1000, order_direction='asc')
  paged_result_by_date("recipients", email_id, date, page, page_size, order_direction)
end

#email_unsubscribes(email_id = "", date = "", page = 1, page_size = 1000, order_direction = 'asc') ⇒ Object

Gets a paged result representing all subscribers who unsubscribed from a journey email



33
34
35
# File 'lib/createsend/journey.rb', line 33

def email_unsubscribes(email_id="", date="", page=1, page_size=1000, order_direction='asc')
  paged_result_by_date("unsubscribes", email_id, date, page, page_size, order_direction)
end

#summaryObject

Get a full summary of a journey



12
13
14
15
# File 'lib/createsend/journey.rb', line 12

def summary
  response = get "/journeys/#{@journey_id}.json"
  Hashie::Mash.new(response)
end