Class: BrevoRuby::TransactionalEmailsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/brevo-ruby/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/brevo-ruby/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/brevo-ruby/api/transactional_emails_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#block_new_domain(block_domain, opts = {}) ⇒ nil

Add a new domain to the list of blocked domains Blocks a new domain in order to avoid messages being sent to the same

Parameters:

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

    the optional parameters

Returns:

  • (nil)


37
38
39
40
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 37

def block_new_domain(block_domain, opts = {})
  block_new_domain_with_http_info(block_domain, opts)
  nil
end

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

Add a new domain to the list of blocked domains Blocks a new domain in order to avoid messages being sent to the same

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
77
78
79
80
81
82
83
84
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 47

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

  # 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(block_domain)
  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#block_new_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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



89
90
91
92
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 89

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



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
127
128
129
130
131
132
133
134
135
136
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 98

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_blocked_domain(domain, opts = {}) ⇒ nil

Unblock an existing domain from the list of blocked domains Unblocks an existing domain from the list of blocked domains

Parameters:

  • domain

    The name of the domain to be deleted

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

    the optional parameters

Returns:

  • (nil)


142
143
144
145
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 142

def delete_blocked_domain(domain, opts = {})
  delete_blocked_domain_with_http_info(domain, opts)
  nil
end

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

Unblock an existing domain from the list of blocked domains Unblocks an existing domain from the list of blocked domains

Parameters:

  • domain

    The name of the domain to be deleted

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
181
182
183
184
185
186
187
188
189
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 152

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


195
196
197
198
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 195

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



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
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 205

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_scheduled_email_by_id(identifier, opts = {}) ⇒ nil

Delete scheduled emails by batchId or messageId Delete scheduled batch of emails by batchId or single scheduled email by messageId

Parameters:

  • identifier

    The &#x60;batchId&#x60; of scheduled emails batch (Should be a valid UUIDv4) or the &#x60;messageId&#x60; of scheduled email.

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

    the optional parameters

Returns:

  • (nil)


244
245
246
247
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 244

def delete_scheduled_email_by_id(identifier, opts = {})
  delete_scheduled_email_by_id_with_http_info(identifier, opts)
  nil
end

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

Delete scheduled emails by batchId or messageId Delete scheduled batch of emails by batchId or single scheduled email by messageId

Parameters:

  • identifier

    The &#x60;batchId&#x60; of scheduled emails batch (Should be a valid UUIDv4) or the &#x60;messageId&#x60; of scheduled email.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 254

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


296
297
298
299
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 296

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



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 305

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 This endpoint will show the aggregated stats for past 90 days by default if ‘startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days

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:



351
352
353
354
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 351

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 This endpoint will show the aggregated stats for past 90 days by default if &#x60;startDate&#x60; and &#x60;endDate&#x60; OR &#x60;days&#x60; is not passed. The date range can not exceed 90 days

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



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
399
400
401
402
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 364

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_blocked_domains(opts = {}) ⇒ GetBlockedDomains

Get the list of blocked domains Get the list of blocked domains

Parameters:

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

    the optional parameters

Returns:



407
408
409
410
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 407

def get_blocked_domains(opts = {})
  data, _status_code, _headers = get_blocked_domains_with_http_info(opts)
  data
end

#get_blocked_domains_with_http_info(opts = {}) ⇒ Array<(GetBlockedDomains, Fixnum, Hash)>

Get the list of blocked domains Get the list of blocked domains

Parameters:

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

    the optional parameters

Returns:

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

    GetBlockedDomains data, response status code and response headers



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
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 416

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

  # 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 => 'GetBlockedDomains')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_blocked_domains\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) This endpoint will show the aggregated stats for past 30 days by default if ‘startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number limitation for the result returned (default to 2500)

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

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed (default to desc)

Returns:



466
467
468
469
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 466

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) This endpoint will show the aggregated stats for past 30 days by default if &#x60;startDate&#x60; and &#x60;endDate&#x60; OR &#x60;days&#x60; is not passed. The date range can not exceed 90 days

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

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed

Returns:

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

    GetEmailEventReport data, response status code and response headers



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
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
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 486

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'] > 5000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_email_event_report, must be smaller than or equal to 5000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_email_event_report, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && opts[:'event'] && !['bounces', 'hardBounces', 'softBounces', 'delivered', 'spam', 'requests', 'opened', 'clicks', 'invalid', 'deferred', 'blocked', 'unsubscribed', 'error', 'loadedByProxy'].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, error, loadedByProxy'
  end
  if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
  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?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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_scheduled_email_by_batch_id(batch_id, opts = {}) ⇒ GetScheduledEmailByBatchId

Fetch scheduled emails by batchId Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old)

Parameters:

  • batch_id

    The batchId of scheduled emails batch (Should be a valid UUIDv4)

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

    the optional parameters

Options Hash (opts):

  • :start_date (Date)

    Mandatory if &#x60;endDate&#x60; is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date.

  • :end_date (Date)

    Mandatory if &#x60;startDate&#x60; 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.

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed (default to desc)

  • :status (String)

    Filter the records by &#x60;status&#x60; of the scheduled email batch or message.

  • :limit (Integer)

    Number of documents returned per page (default to 100)

  • :offset (Integer)

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

Returns:



557
558
559
560
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 557

def get_scheduled_email_by_batch_id(batch_id, opts = {})
  data, _status_code, _headers = get_scheduled_email_by_batch_id_with_http_info(batch_id, opts)
  data
end

#get_scheduled_email_by_batch_id_with_http_info(batch_id, opts = {}) ⇒ Array<(GetScheduledEmailByBatchId, Fixnum, Hash)>

Fetch scheduled emails by batchId Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old)

Parameters:

  • batch_id

    The batchId of scheduled emails batch (Should be a valid UUIDv4)

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

    the optional parameters

Options Hash (opts):

  • :start_date (Date)

    Mandatory if &#x60;endDate&#x60; is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date.

  • :end_date (Date)

    Mandatory if &#x60;startDate&#x60; 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.

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed

  • :status (String)

    Filter the records by &#x60;status&#x60; of the scheduled email batch or message.

  • :limit (Integer)

    Number of documents returned per page

  • :offset (Integer)

    Index of the first document on the page

Returns:

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

    GetScheduledEmailByBatchId data, response status code and response headers



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
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 573

def get_scheduled_email_by_batch_id_with_http_info(batch_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_scheduled_email_by_batch_id ...'
  end
  # verify the required parameter 'batch_id' is set
  if @api_client.config.client_side_validation && batch_id.nil?
    fail ArgumentError, "Missing the required parameter 'batch_id' when calling TransactionalEmailsApi.get_scheduled_email_by_batch_id"
  end
  if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
  end
  if @api_client.config.client_side_validation && opts[:'status'] && !['processed', 'inProgress', 'queued'].include?(opts[:'status'])
    fail ArgumentError, 'invalid value for "status", must be one of processed, inProgress, queued'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_scheduled_email_by_batch_id, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_scheduled_email_by_batch_id, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/smtp/emailStatus/{batchId}'.sub('{' + 'batchId' + '}', batch_id.to_s)

  # 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[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'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 => 'GetScheduledEmailByBatchId')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_scheduled_email_by_batch_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_scheduled_email_by_message_id(message_id, opts = {}) ⇒ GetScheduledEmailByMessageId

Fetch scheduled email by messageId Fetch scheduled email by messageId (Can retrieve data upto 30 days old)

Parameters:

  • message_id

    The messageId of scheduled email

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

    the optional parameters

Options Hash (opts):

  • :start_date (Date)

    Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date.

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



639
640
641
642
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 639

def get_scheduled_email_by_message_id(message_id, opts = {})
  data, _status_code, _headers = get_scheduled_email_by_message_id_with_http_info(message_id, opts)
  data
end

#get_scheduled_email_by_message_id_with_http_info(message_id, opts = {}) ⇒ Array<(GetScheduledEmailByMessageId, Fixnum, Hash)>

Fetch scheduled email by messageId Fetch scheduled email by messageId (Can retrieve data upto 30 days old)

Parameters:

  • message_id

    The messageId of scheduled email

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

    the optional parameters

Options Hash (opts):

  • :start_date (Date)

    Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date.

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



651
652
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/brevo-ruby/api/transactional_emails_api.rb', line 651

def get_scheduled_email_by_message_id_with_http_info(message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_scheduled_email_by_message_id ...'
  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.get_scheduled_email_by_message_id"
  end
  # resource path
  local_var_path = '/smtp/emailStatus/{messageId}'.sub('{' + 'messageId' + '}', message_id.to_s)

  # 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?

  # 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 => 'GetScheduledEmailByMessageId')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_scheduled_email_by_message_id\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

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed (default to desc)

Returns:



702
703
704
705
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 702

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

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed

Returns:

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

    GetReports data, response status code and response headers



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
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 717

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

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_smtp_report, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
  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?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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:



774
775
776
777
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 774

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



783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 783

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)

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed (default to desc)

Returns:



829
830
831
832
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 829

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

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed

Returns:

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

    GetSmtpTemplates data, response status code and response headers



841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
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
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 841

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

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_smtp_templates, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
  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?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed (default to desc)

Returns:



900
901
902
903
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 900

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

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed

Returns:

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

    GetTransacBlockedContacts data, response status code and response headers



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
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 914

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

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_transac_blocked_contacts, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
  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?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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:



970
971
972
973
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 970

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



979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 979

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 (String)

    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 (String)

    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.

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed (default to desc)

  • :limit (Integer)

    Number of documents returned per page (default to 500)

  • :offset (Integer)

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

Returns:



1030
1031
1032
1033
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 1030

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 (String)

    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 (String)

    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.

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed

  • :limit (Integer)

    Number of documents returned per page

  • :offset (Integer)

    Index of the first document in the page

Returns:

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

    GetTransacEmailsList data, response status code and response headers



1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 1047

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
  if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
  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_transac_emails_list, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_transac_emails_list, must be greater than or equal to 0.'
  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?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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 => '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_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)


1106
1107
1108
1109
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 1106

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



1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 1116

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:



1162
1163
1164
1165
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 1162

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



1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 1171

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

#setUserAgent(user_agent) ⇒ Object

Set custom user_agent if explicitly passed in api default will still remain Swagger-Codegen/#VERSION/ruby



25
26
27
28
29
30
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 25

def setUserAgent(user_agent)
  @user_agent = user_agent
  if user_agent.is_a?(String) && user_agent.downcase.start_with?('brevo_')
    @api_client.default_headers['User-Agent'] = @user_agent
  end
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)


1214
1215
1216
1217
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 1214

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



1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 1223

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)


1265
1266
1267
1268
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 1265

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



1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 1274

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)


1317
1318
1319
1320
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 1317

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



1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
# File 'lib/brevo-ruby/api/transactional_emails_api.rb', line 1327

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