Class: SibApiV3Sdk::TransactionalEmailsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TransactionalEmailsApi

Returns a new instance of TransactionalEmailsApi.



19
20
21
# File 'lib/sib-api-v3-sdk/api/transactional_emails_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/transactional_emails_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

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

Create an email template

Parameters:

  • smtp_template

    values to update in transactional email template

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

    the optional parameters

Returns:



26
27
28
29
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 26

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

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

Create an email template

Parameters:

  • smtp_template

    values to update in transactional email template

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

    the optional parameters

Returns:

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

    CreateModel data, response status code and response headers



35
36
37
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
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 35

def create_smtp_template_with_http_info(smtp_template, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.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 TransactionalEmailsApi.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: TransactionalEmailsApi#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)


79
80
81
82
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 79

def delete_hardbounces(opts = {})
  delete_hardbounces_with_http_info(opts)
  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



89
90
91
92
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
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 89

def delete_hardbounces_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.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: TransactionalEmailsApi#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 email template

Parameters:

  • template_id

    id of the template

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

    the optional parameters

Returns:

  • (nil)


127
128
129
130
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 127

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

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

Delete an inactive email 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



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
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 136

def delete_smtp_template_with_http_info(template_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.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 TransactionalEmailsApi.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: TransactionalEmailsApi#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 transactional email 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:



181
182
183
184
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 181

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

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

Get your transactional email 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



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
228
229
230
231
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 193

def get_aggregated_smtp_report_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.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: TransactionalEmailsApi#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 transactional email 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:



245
246
247
248
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 245

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

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

Get all your transactional email 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



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
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
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 263

def get_email_event_report_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.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 TransactionalEmailsApi.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: TransactionalEmailsApi#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 transactional email 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 10)

  • :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:



324
325
326
327
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 324

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

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

Get your transactional email 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



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
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
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 338

def get_smtp_report_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_smtp_report ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 30
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_smtp_report, must be smaller than or equal to 30.'
  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: TransactionalEmailsApi#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 information

Parameters:

  • template_id

    id of the template

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

    the optional parameters

Returns:



387
388
389
390
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 387

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

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

Returns the template information

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



396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 396

def get_smtp_template_with_http_info(template_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.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 TransactionalEmailsApi.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: TransactionalEmailsApi#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 email 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:



441
442
443
444
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 441

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

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

Get the list of email 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



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 452

def get_smtp_templates_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.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 TransactionalEmailsApi.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: TransactionalEmailsApi#get_smtp_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transac_blocked_contacts(opts = {}) ⇒ GetTransacBlockedContacts

Get the list of blocked or unsubscribed transactional contacts

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :start_date (String)

    Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts

  • :end_date (String)

    Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts

  • :limit (Integer)

    Number of documents returned per page (default to 50)

  • :offset (Integer)

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

  • :senders (Array<String>)

    Comma separated list of emails of the senders from which contacts are blocked or unsubscribed

Returns:



502
503
504
505
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 502

def get_transac_blocked_contacts(opts = {})
  data, _status_code, _headers = get_transac_blocked_contacts_with_http_info(opts)
  data
end

#get_transac_blocked_contacts_with_http_info(opts = {}) ⇒ Array<(GetTransacBlockedContacts, Fixnum, Hash)>

Get the list of blocked or unsubscribed transactional contacts

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :start_date (String)

    Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts

  • :end_date (String)

    Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts

  • :limit (Integer)

    Number of documents returned per page

  • :offset (Integer)

    Index of the first document on the page

  • :senders (Array<String>)

    Comma separated list of emails of the senders from which contacts are blocked or unsubscribed

Returns:

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

    GetTransacBlockedContacts data, response status code and response headers



515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
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
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 515

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

  # resource path
  local_var_path = '/smtp/blockedContacts'

  # 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[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'senders'] = @api_client.build_collection_param(opts[:'senders'], :csv) if !opts[:'senders'].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 => 'GetTransacBlockedContacts')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_transac_blocked_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transac_email_content(uuid, opts = {}) ⇒ GetTransacEmailContent

Get the personalized content of a sent transactional email

Parameters:

  • uuid

    Unique id of the transactional email that has been sent to a particular contact

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

    the optional parameters

Returns:



563
564
565
566
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 563

def get_transac_email_content(uuid, opts = {})
  data, _status_code, _headers = get_transac_email_content_with_http_info(uuid, opts)
  data
end

#get_transac_email_content_with_http_info(uuid, opts = {}) ⇒ Array<(GetTransacEmailContent, Fixnum, Hash)>

Get the personalized content of a sent transactional email

Parameters:

  • uuid

    Unique id of the transactional email that has been sent to a particular contact

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

    the optional parameters

Returns:

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

    GetTransacEmailContent data, response status code and response headers



572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 572

def get_transac_email_content_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_transac_email_content ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling TransactionalEmailsApi.get_transac_email_content"
  end
  # resource path
  local_var_path = '/smtp/emails/{uuid}'.sub('{' + 'uuid' + '}', uuid.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 => 'GetTransacEmailContent')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_transac_email_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transac_emails_list(opts = {}) ⇒ GetTransacEmailsList

Get the list of transactional emails on the basis of allowed filters This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :email (String)

    Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent.

  • :template_id (Integer)

    Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email.

  • :message_id (String)

    Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent.

  • :start_date (Date)

    Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month.

  • :end_date (Date)

    Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month.

Returns:



620
621
622
623
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 620

def get_transac_emails_list(opts = {})
  data, _status_code, _headers = get_transac_emails_list_with_http_info(opts)
  data
end

#get_transac_emails_list_with_http_info(opts = {}) ⇒ Array<(GetTransacEmailsList, Fixnum, Hash)>

Get the list of transactional emails on the basis of allowed filters This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :email (String)

    Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent.

  • :template_id (Integer)

    Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email.

  • :message_id (String)

    Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent.

  • :start_date (Date)

    Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month.

  • :end_date (Date)

    Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month.

Returns:

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

    GetTransacEmailsList data, response status code and response headers



634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 634

def get_transac_emails_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_transac_emails_list ...'
  end
  # resource path
  local_var_path = '/smtp/emails'

  # query parameters
  query_params = {}
  query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil?
  query_params[:'templateId'] = opts[:'template_id'] if !opts[:'template_id'].nil?
  query_params[:'messageId'] = opts[:'message_id'] if !opts[:'message_id'].nil?
  query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].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 => 'GetTransacEmailsList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_transac_emails_list\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:



680
681
682
683
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 680

def send_template(template_id, send_email, opts = {})
  data, _status_code, _headers = send_template_with_http_info(template_id, send_email, opts)
  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



691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 691

def send_template_with_http_info(template_id, send_email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.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 TransactionalEmailsApi.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 TransactionalEmailsApi.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: TransactionalEmailsApi#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)


739
740
741
742
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 739

def send_test_template(template_id, send_test_email, opts = {})
  send_test_template_with_http_info(template_id, send_test_email, opts)
  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



749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 749

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: TransactionalEmailsApi.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 TransactionalEmailsApi.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 TransactionalEmailsApi.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: TransactionalEmailsApi#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:



795
796
797
798
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 795

def send_transac_email(send_smtp_email, opts = {})
  data, _status_code, _headers = send_transac_email_with_http_info(send_smtp_email, opts)
  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



804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 804

def send_transac_email_with_http_info(send_smtp_email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.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 TransactionalEmailsApi.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: TransactionalEmailsApi#send_transac_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#smtp_blocked_contacts_email_delete(email, opts = {}) ⇒ nil

Unblock or resubscribe a transactional contact

Parameters:

  • email

    contact email (urlencoded) to unblock.

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

    the optional parameters

Returns:

  • (nil)


847
848
849
850
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 847

def smtp_blocked_contacts_email_delete(email, opts = {})
  smtp_blocked_contacts_email_delete_with_http_info(email, opts)
  nil
end

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

Unblock or resubscribe a transactional contact

Parameters:

  • email

    contact email (urlencoded) to unblock.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 856

def smtp_blocked_contacts_email_delete_with_http_info(email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.smtp_blocked_contacts_email_delete ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling TransactionalEmailsApi.smtp_blocked_contacts_email_delete"
  end
  # resource path
  local_var_path = '/smtp/blockedContacts/{email}'.sub('{' + 'email' + '}', email.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: TransactionalEmailsApi#smtp_blocked_contacts_email_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#smtp_log_message_id_delete(message_id, opts = {}) ⇒ nil

Delete an SMTP transactional log

Parameters:

  • message_id

    MessageId of the transactional log to delete

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

    the optional parameters

Returns:

  • (nil)


898
899
900
901
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 898

def smtp_log_message_id_delete(message_id, opts = {})
  smtp_log_message_id_delete_with_http_info(message_id, opts)
  nil
end

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

Delete an SMTP transactional log

Parameters:

  • message_id

    MessageId of the transactional log to delete

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 907

def smtp_log_message_id_delete_with_http_info(message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.smtp_log_message_id_delete ...'
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling TransactionalEmailsApi.smtp_log_message_id_delete"
  end
  # resource path
  local_var_path = '/smtp/log/{messageId}'.sub('{' + 'messageId' + '}', message_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: TransactionalEmailsApi#smtp_log_message_id_delete\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

Update an email template

Parameters:

  • template_id

    id of the template

  • smtp_template

    values to update in transactional email template

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

    the optional parameters

Returns:

  • (nil)


950
951
952
953
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 950

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

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

Update an email template

Parameters:

  • template_id

    id of the template

  • smtp_template

    values to update in transactional email template

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
# File 'lib/sib-api-v3-sdk/api/transactional_emails_api.rb', line 960

def update_smtp_template_with_http_info(template_id, smtp_template, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.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 TransactionalEmailsApi.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 TransactionalEmailsApi.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: TransactionalEmailsApi#update_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end