Class: BombBomb::EmailsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/bombbomb/api/emails_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EmailsApi

Returns a new instance of EmailsApi.



30
31
32
# File 'lib/bombbomb/api/emails_api.rb', line 30

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



28
29
30
# File 'lib/bombbomb/api/emails_api.rb', line 28

def api_client
  @api_client
end

Instance Method Details

#create_printing_press_email(template_id, content, opts = {}) ⇒ nil

Create an Email with Printing Press Prints an email using the template id and content to the users account.If a video id is included, it will replace any video placeholders with that video.

Parameters:

  • template_id

    The template id to be printed.

  • content

    The content of the email.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :email_id (String)

    The email id to be printed to.

  • :video_id (String)

    A video to replace video place holders with.

  • :subject_line (String)

    The subject line to be printed.

Returns:

  • (nil)


43
44
45
46
# File 'lib/bombbomb/api/emails_api.rb', line 43

def create_printing_press_email(template_id, content, opts = {})
  create_printing_press_email_with_http_info(template_id, content, opts)
  return nil
end

#create_printing_press_email_with_http_info(template_id, content, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create an Email with Printing Press Prints an email using the template id and content to the users account.If a video id is included, it will replace any video placeholders with that video.

Parameters:

  • template_id

    The template id to be printed.

  • content

    The content of the email.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :email_id (String)

    The email id to be printed to.

  • :video_id (String)

    A video to replace video place holders with.

  • :subject_line (String)

    The subject line to be printed.

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/bombbomb/api/emails_api.rb', line 57

def create_printing_press_email_with_http_info(template_id, content, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EmailsApi.create_printing_press_email ..."
  end
  # verify the required parameter 'template_id' is set
  fail ArgumentError, "Missing the required parameter 'template_id' when calling EmailsApi.create_printing_press_email" if template_id.nil?
  # verify the required parameter 'content' is set
  fail ArgumentError, "Missing the required parameter 'content' when calling EmailsApi.create_printing_press_email" if content.nil?
  # resource path
  local_var_path = "/emails/print".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}
  form_params["templateId"] = template_id
  form_params["content"] = content
  form_params["emailId"] = opts[:'email_id'] if !opts[:'email_id'].nil?
  form_params["videoId"] = opts[:'video_id'] if !opts[:'video_id'].nil?
  form_params["subjectLine"] = opts[:'subject_line'] if !opts[:'subject_line'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailsApi#create_printing_press_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_tracking(email_id, opts = {}) ⇒ nil

Get Email Tracking Get Tracking data for all sends of an Email

Parameters:

  • email_id

    ID of the email

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :job_id (String)

    ID of the Job (or null for all jobs)

Returns:

  • (nil)


111
112
113
114
# File 'lib/bombbomb/api/emails_api.rb', line 111

def get_email_tracking(email_id, opts = {})
  get_email_tracking_with_http_info(email_id, opts)
  return nil
end

#get_email_tracking_interactions(email_id, opts = {}) ⇒ nil

Get Email Tracking Interactions Get Contact detail interactions for an Email

Parameters:

  • email_id

    ID of the email

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :job_id (String)

    ID of the Job (or null for all jobs)

  • :interaction_type (String)

    Interaction type to order and filter by

  • :search_term (String)

    Search term to filer by

Returns:

  • (nil)


172
173
174
175
# File 'lib/bombbomb/api/emails_api.rb', line 172

def get_email_tracking_interactions(email_id, opts = {})
  get_email_tracking_interactions_with_http_info(email_id, opts)
  return nil
end

#get_email_tracking_interactions_with_http_info(email_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get Email Tracking Interactions Get Contact detail interactions for an Email

Parameters:

  • email_id

    ID of the email

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :job_id (String)

    ID of the Job (or null for all jobs)

  • :interaction_type (String)

    Interaction type to order and filter by

  • :search_term (String)

    Search term to filer by

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/bombbomb/api/emails_api.rb', line 185

def get_email_tracking_interactions_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EmailsApi.get_email_tracking_interactions ..."
  end
  # verify the required parameter 'email_id' is set
  fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailsApi.get_email_tracking_interactions" if email_id.nil?
  # resource path
  local_var_path = "/emails/{emailId}/tracking/interactions".sub('{format}','json').sub('{' + 'emailId' + '}', email_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'jobId'] = opts[:'job_id'] if !opts[:'job_id'].nil?
  query_params[:'interactionType'] = opts[:'interaction_type'] if !opts[:'interaction_type'].nil?
  query_params[:'searchTerm'] = opts[:'search_term'] if !opts[:'search_term'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailsApi#get_email_tracking_interactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_tracking_with_http_info(email_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get Email Tracking Get Tracking data for all sends of an Email

Parameters:

  • email_id

    ID of the email

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :job_id (String)

    ID of the Job (or null for all jobs)

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/bombbomb/api/emails_api.rb', line 122

def get_email_tracking_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EmailsApi.get_email_tracking ..."
  end
  # verify the required parameter 'email_id' is set
  fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailsApi.get_email_tracking" if email_id.nil?
  # resource path
  local_var_path = "/emails/{emailId}/tracking".sub('{format}','json').sub('{' + 'emailId' + '}', email_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'jobId'] = opts[:'job_id'] if !opts[:'job_id'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailsApi#get_email_tracking\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_hourly_email_tracking(email_id, opts = {}) ⇒ nil

Get Hourly Email Tracking Get Tracking data for an Email, broken down by the hour and filterable by an Interaction type

Parameters:

  • email_id

    ID of the email

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :job_id (String)

    ID of the Job (or null for all jobs)

  • :interaction_type (String)

    Interaction type to filter by

Returns:

  • (nil)


236
237
238
239
# File 'lib/bombbomb/api/emails_api.rb', line 236

def get_hourly_email_tracking(email_id, opts = {})
  get_hourly_email_tracking_with_http_info(email_id, opts)
  return nil
end

#get_hourly_email_tracking_with_http_info(email_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get Hourly Email Tracking Get Tracking data for an Email, broken down by the hour and filterable by an Interaction type

Parameters:

  • email_id

    ID of the email

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :job_id (String)

    ID of the Job (or null for all jobs)

  • :interaction_type (String)

    Interaction type to filter by

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/bombbomb/api/emails_api.rb', line 248

def get_hourly_email_tracking_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EmailsApi.get_hourly_email_tracking ..."
  end
  # verify the required parameter 'email_id' is set
  fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailsApi.get_hourly_email_tracking" if email_id.nil?
  # resource path
  local_var_path = "/emails/{emailId}/tracking/hourly".sub('{format}','json').sub('{' + 'emailId' + '}', email_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'jobId'] = opts[:'job_id'] if !opts[:'job_id'].nil?
  query_params[:'interactionType'] = opts[:'interaction_type'] if !opts[:'interaction_type'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailsApi#get_hourly_email_tracking\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end