Class: SibApiV3Sdk::SMTPApi

Inherits:
Object
  • Object
show all
Defined in:
lib/sib-api-v3-sdk/api/smtp_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SMTPApi

Returns a new instance of SMTPApi.



19
20
21
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_smtp_template(smtp_template, opts = {}) ⇒ CreateModel

Create an smtp template

Parameters:

  • smtp_template

    values to update in smtp template

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 28

def create_smtp_template(smtp_template, opts = {})
  data, _status_code, _headers = create_smtp_template_with_http_info(smtp_template, opts)
  return data
end

#create_smtp_template_with_http_info(smtp_template, opts = {}) ⇒ Array<(CreateModel, Fixnum, Hash)>

Create an smtp template

Parameters:

  • smtp_template

    values to update in smtp template

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

    the optional parameters

Returns:

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

    CreateModel data, response status code and response headers



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 38

def create_smtp_template_with_http_info(smtp_template, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMTPApi.create_smtp_template ..."
  end
  # verify the required parameter 'smtp_template' is set
  if @api_client.config.client_side_validation && smtp_template.nil?
    fail ArgumentError, "Missing the required parameter 'smtp_template' when calling SMTPApi.create_smtp_template"
  end
  # resource path
  local_var_path = "/smtp/templates"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(smtp_template)
  auth_names = ['api-key', 'partner-key']
  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,
    :return_type => 'CreateModel')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMTPApi#create_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_hardbounces(opts = {}) ⇒ nil

Delete hardbounces Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures)

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


83
84
85
86
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 83

def delete_hardbounces(opts = {})
  delete_hardbounces_with_http_info(opts)
  return nil
end

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

Delete hardbounces Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures)

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    nil, response status code and response headers



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 93

def delete_hardbounces_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMTPApi.delete_hardbounces ..."
  end
  # resource path
  local_var_path = "/smtp/deleteHardbounces"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'delete_hardbounces'])
  auth_names = ['api-key', 'partner-key']
  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: SMTPApi#delete_hardbounces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_smtp_template(template_id, opts = {}) ⇒ nil

Delete an inactive smtp template

Parameters:

  • template_id

    id of the template

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

    the optional parameters

Returns:

  • (nil)


133
134
135
136
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 133

def delete_smtp_template(template_id, opts = {})
  delete_smtp_template_with_http_info(template_id, opts)
  return nil
end

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

Delete an inactive smtp template

Parameters:

  • template_id

    id of the template

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 143

def delete_smtp_template_with_http_info(template_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMTPApi.delete_smtp_template ..."
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.delete_smtp_template"
  end
  # resource path
  local_var_path = "/smtp/templates/{templateId}".sub('{' + 'templateId' + '}', template_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:DELETE, 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: SMTPApi#delete_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_aggregated_smtp_report(opts = {}) ⇒ GetAggregatedReport

Get your SMTP activity aggregated over a period of time

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :start_date (String)

    Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate

  • :end_date (String)

    Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate

  • :days (Integer)

    Number of days in the past including today (positive integer). Not compatible with &#39;startDate&#39; and &#39;endDate&#39;

  • :tag (String)

    Tag of the emails

Returns:



190
191
192
193
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 190

def get_aggregated_smtp_report(opts = {})
  data, _status_code, _headers = get_aggregated_smtp_report_with_http_info(opts)
  return data
end

#get_aggregated_smtp_report_with_http_info(opts = {}) ⇒ Array<(GetAggregatedReport, Fixnum, Hash)>

Get your SMTP activity aggregated over a period of time

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :start_date (String)

    Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate

  • :end_date (String)

    Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate

  • :days (Integer)

    Number of days in the past including today (positive integer). Not compatible with &#39;startDate&#39; and &#39;endDate&#39;

  • :tag (String)

    Tag of the emails

Returns:

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

    GetAggregatedReport data, response status code and response headers



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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 203

def get_aggregated_smtp_report_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMTPApi.get_aggregated_smtp_report ..."
  end
  # resource path
  local_var_path = "/smtp/statistics/aggregatedReport"

  # query parameters
  query_params = {}
  query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
  query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  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,
    :return_type => 'GetAggregatedReport')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMTPApi#get_aggregated_smtp_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_event_report(opts = {}) ⇒ GetEmailEventReport

Get all your SMTP activity (unaggregated events)

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number limitation for the result returned (default to 50)

  • :offset (Integer)

    Beginning point in the list to retrieve from. (default to 0)

  • :start_date (String)

    Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate

  • :end_date (String)

    Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate

  • :days (Integer)

    Number of days in the past including today (positive integer). Not compatible with &#39;startDate&#39; and &#39;endDate&#39;

  • :email (String)

    Filter the report for a specific email addresses

  • :event (String)

    Filter the report for a specific event type

  • :tags (String)

    Filter the report for tags (serialized and urlencoded array)

  • :message_id (String)

    Filter on a specific message id

  • :template_id (Integer)

    Filter on a specific template id

Returns:



257
258
259
260
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 257

def get_email_event_report(opts = {})
  data, _status_code, _headers = get_email_event_report_with_http_info(opts)
  return data
end

#get_email_event_report_with_http_info(opts = {}) ⇒ Array<(GetEmailEventReport, Fixnum, Hash)>

Get all your SMTP activity (unaggregated events)

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number limitation for the result returned

  • :offset (Integer)

    Beginning point in the list to retrieve from.

  • :start_date (String)

    Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate

  • :end_date (String)

    Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate

  • :days (Integer)

    Number of days in the past including today (positive integer). Not compatible with &#39;startDate&#39; and &#39;endDate&#39;

  • :email (String)

    Filter the report for a specific email addresses

  • :event (String)

    Filter the report for a specific event type

  • :tags (String)

    Filter the report for tags (serialized and urlencoded array)

  • :message_id (String)

    Filter on a specific message id

  • :template_id (Integer)

    Filter on a specific template id

Returns:

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

    GetEmailEventReport data, response status code and response headers



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 276

def get_email_event_report_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMTPApi.get_email_event_report ..."
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMTPApi.get_email_event_report, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && opts[:'event'] && !['bounces', 'hardBounces', 'softBounces', 'delivered', 'spam', 'requests', 'opened', 'clicks', 'invalid', 'deferred', 'blocked', 'unsubscribed'].include?(opts[:'event'])
    fail ArgumentError, 'invalid value for "event", must be one of bounces, hardBounces, softBounces, delivered, spam, requests, opened, clicks, invalid, deferred, blocked, unsubscribed'
  end
  # resource path
  local_var_path = "/smtp/statistics/events"

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
  query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil?
  query_params[:'event'] = opts[:'event'] if !opts[:'event'].nil?
  query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?
  query_params[:'messageId'] = opts[:'message_id'] if !opts[:'message_id'].nil?
  query_params[:'templateId'] = opts[:'template_id'] if !opts[:'template_id'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  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,
    :return_type => 'GetEmailEventReport')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMTPApi#get_email_event_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_smtp_report(opts = {}) ⇒ GetReports

Get your SMTP activity aggregated per day

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents returned per page (default to 50)

  • :offset (Integer)

    Index of the first document on the page (default to 0)

  • :start_date (String)

    Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD)

  • :end_date (String)

    Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD)

  • :days (Integer)

    Number of days in the past including today (positive integer). Not compatible with &#39;startDate&#39; and &#39;endDate&#39;

  • :tag (String)

    Tag of the emails

Returns:



339
340
341
342
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 339

def get_smtp_report(opts = {})
  data, _status_code, _headers = get_smtp_report_with_http_info(opts)
  return data
end

#get_smtp_report_with_http_info(opts = {}) ⇒ Array<(GetReports, Fixnum, Hash)>

Get your SMTP activity aggregated per day

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents returned per page

  • :offset (Integer)

    Index of the first document on the page

  • :start_date (String)

    Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD)

  • :end_date (String)

    Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD)

  • :days (Integer)

    Number of days in the past including today (positive integer). Not compatible with &#39;startDate&#39; and &#39;endDate&#39;

  • :tag (String)

    Tag of the emails

Returns:

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

    GetReports data, response status code and response headers



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 354

def get_smtp_report_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMTPApi.get_smtp_report ..."
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMTPApi.get_smtp_report, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = "/smtp/statistics/reports"

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
  query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  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,
    :return_type => 'GetReports')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMTPApi#get_smtp_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_smtp_template(template_id, opts = {}) ⇒ GetSmtpTemplateOverview

Returns the template informations

Parameters:

  • template_id

    id of the template

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

    the optional parameters

Returns:



405
406
407
408
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 405

def get_smtp_template(template_id, opts = {})
  data, _status_code, _headers = get_smtp_template_with_http_info(template_id, opts)
  return data
end

#get_smtp_template_with_http_info(template_id, opts = {}) ⇒ Array<(GetSmtpTemplateOverview, Fixnum, Hash)>

Returns the template informations

Parameters:

  • template_id

    id of the template

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

    the optional parameters

Returns:

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

    GetSmtpTemplateOverview data, response status code and response headers



415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 415

def get_smtp_template_with_http_info(template_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMTPApi.get_smtp_template ..."
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.get_smtp_template"
  end
  # resource path
  local_var_path = "/smtp/templates/{templateId}".sub('{' + 'templateId' + '}', template_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  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,
    :return_type => 'GetSmtpTemplateOverview')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMTPApi#get_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_smtp_templates(opts = {}) ⇒ GetSmtpTemplates

Get the list of SMTP templates

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :template_status (BOOLEAN)

    Filter on the status of the template. Active &#x3D; true, inactive &#x3D; false

  • :limit (Integer)

    Number of documents returned per page (default to 50)

  • :offset (Integer)

    Index of the first document in the page (default to 0)

Returns:



462
463
464
465
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 462

def get_smtp_templates(opts = {})
  data, _status_code, _headers = get_smtp_templates_with_http_info(opts)
  return data
end

#get_smtp_templates_with_http_info(opts = {}) ⇒ Array<(GetSmtpTemplates, Fixnum, Hash)>

Get the list of SMTP templates

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :template_status (BOOLEAN)

    Filter on the status of the template. Active &#x3D; true, inactive &#x3D; false

  • :limit (Integer)

    Number of documents returned per page

  • :offset (Integer)

    Index of the first document in the page

Returns:

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

    GetSmtpTemplates data, response status code and response headers



474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 474

def get_smtp_templates_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMTPApi.get_smtp_templates ..."
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMTPApi.get_smtp_templates, must be smaller than or equal to 1000.'
  end

  # resource path
  local_var_path = "/smtp/templates"

  # query parameters
  query_params = {}
  query_params[:'templateStatus'] = opts[:'template_status'] if !opts[:'template_status'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  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,
    :return_type => 'GetSmtpTemplates')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMTPApi#get_smtp_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_template(template_id, send_email, opts = {}) ⇒ SendTemplateEmail

Send a template This endpoint is deprecated. Prefer v3/smtp/email instead.

Parameters:

  • template_id

    Id of the template

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

    the optional parameters

Returns:



523
524
525
526
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 523

def send_template(template_id, send_email, opts = {})
  data, _status_code, _headers = send_template_with_http_info(template_id, send_email, opts)
  return data
end

#send_template_with_http_info(template_id, send_email, opts = {}) ⇒ Array<(SendTemplateEmail, Fixnum, Hash)>

Send a template This endpoint is deprecated. Prefer v3/smtp/email instead.

Parameters:

  • template_id

    Id of the template

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

    the optional parameters

Returns:

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

    SendTemplateEmail data, response status code and response headers



534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 534

def send_template_with_http_info(template_id, send_email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMTPApi.send_template ..."
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.send_template"
  end
  # verify the required parameter 'send_email' is set
  if @api_client.config.client_side_validation && send_email.nil?
    fail ArgumentError, "Missing the required parameter 'send_email' when calling SMTPApi.send_template"
  end
  # resource path
  local_var_path = "/smtp/templates/{templateId}/send".sub('{' + 'templateId' + '}', template_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(send_email)
  auth_names = ['api-key', 'partner-key']
  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,
    :return_type => 'SendTemplateEmail')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMTPApi#send_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_test_template(template_id, send_test_email, opts = {}) ⇒ nil

Send a template to your test list

Parameters:

  • template_id

    Id of the template

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

    the optional parameters

Returns:

  • (nil)


584
585
586
587
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 584

def send_test_template(template_id, send_test_email, opts = {})
  send_test_template_with_http_info(template_id, send_test_email, opts)
  return nil
end

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

Send a template to your test list

Parameters:

  • template_id

    Id of the template

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 595

def send_test_template_with_http_info(template_id, send_test_email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMTPApi.send_test_template ..."
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.send_test_template"
  end
  # verify the required parameter 'send_test_email' is set
  if @api_client.config.client_side_validation && send_test_email.nil?
    fail ArgumentError, "Missing the required parameter 'send_test_email' when calling SMTPApi.send_test_template"
  end
  # resource path
  local_var_path = "/smtp/templates/{templateId}/sendTest".sub('{' + 'templateId' + '}', template_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(send_test_email)
  auth_names = ['api-key', 'partner-key']
  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: SMTPApi#send_test_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_transac_email(send_smtp_email, opts = {}) ⇒ CreateSmtpEmail

Send a transactional email

Parameters:

  • send_smtp_email

    Values to send a transactional email

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

    the optional parameters

Returns:



643
644
645
646
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 643

def send_transac_email(send_smtp_email, opts = {})
  data, _status_code, _headers = send_transac_email_with_http_info(send_smtp_email, opts)
  return data
end

#send_transac_email_with_http_info(send_smtp_email, opts = {}) ⇒ Array<(CreateSmtpEmail, Fixnum, Hash)>

Send a transactional email

Parameters:

  • send_smtp_email

    Values to send a transactional email

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

    the optional parameters

Returns:

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

    CreateSmtpEmail data, response status code and response headers



653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 653

def send_transac_email_with_http_info(send_smtp_email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMTPApi.send_transac_email ..."
  end
  # verify the required parameter 'send_smtp_email' is set
  if @api_client.config.client_side_validation && send_smtp_email.nil?
    fail ArgumentError, "Missing the required parameter 'send_smtp_email' when calling SMTPApi.send_transac_email"
  end
  # resource path
  local_var_path = "/smtp/email"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(send_smtp_email)
  auth_names = ['api-key', 'partner-key']
  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,
    :return_type => 'CreateSmtpEmail')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMTPApi#send_transac_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_smtp_template(template_id, smtp_template, opts = {}) ⇒ nil

Updates an smtp templates

Parameters:

  • template_id

    id of the template

  • smtp_template

    values to update in smtp template

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

    the optional parameters

Returns:

  • (nil)


699
700
701
702
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 699

def update_smtp_template(template_id, smtp_template, opts = {})
  update_smtp_template_with_http_info(template_id, smtp_template, opts)
  return nil
end

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

Updates an smtp templates

Parameters:

  • template_id

    id of the template

  • smtp_template

    values to update in smtp template

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 710

def update_smtp_template_with_http_info(template_id, smtp_template, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMTPApi.update_smtp_template ..."
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.update_smtp_template"
  end
  # verify the required parameter 'smtp_template' is set
  if @api_client.config.client_side_validation && smtp_template.nil?
    fail ArgumentError, "Missing the required parameter 'smtp_template' when calling SMTPApi.update_smtp_template"
  end
  # resource path
  local_var_path = "/smtp/templates/{templateId}".sub('{' + 'templateId' + '}', template_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(smtp_template)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:PUT, 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: SMTPApi#update_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end