Class: SibApiV3Sdk::SMTPApi
- Inherits:
-
Object
- Object
- SibApiV3Sdk::SMTPApi
- Defined in:
- lib/sib-api-v3-sdk/api/smtp_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_smtp_template(smtp_template, opts = {}) ⇒ CreateModel
Create an smtp template.
-
#create_smtp_template_with_http_info(smtp_template, opts = {}) ⇒ Array<(CreateModel, Fixnum, Hash)>
Create an smtp template.
-
#delete_hardbounces(opts = {}) ⇒ nil
Delete hardbounces Delete hardbounces.
-
#delete_hardbounces_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete hardbounces Delete hardbounces.
-
#delete_smtp_template(template_id, opts = {}) ⇒ nil
Delete an inactive smtp template.
-
#delete_smtp_template_with_http_info(template_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete an inactive smtp template.
-
#get_aggregated_smtp_report(opts = {}) ⇒ GetAggregatedReport
Get your SMTP activity aggregated over a period of time.
-
#get_aggregated_smtp_report_with_http_info(opts = {}) ⇒ Array<(GetAggregatedReport, Fixnum, Hash)>
Get your SMTP activity aggregated over a period of time.
-
#get_email_event_report(opts = {}) ⇒ GetEmailEventReport
Get all your SMTP activity (unaggregated events).
-
#get_email_event_report_with_http_info(opts = {}) ⇒ Array<(GetEmailEventReport, Fixnum, Hash)>
Get all your SMTP activity (unaggregated events).
-
#get_smtp_report(opts = {}) ⇒ GetReports
Get your SMTP activity aggregated per day.
-
#get_smtp_report_with_http_info(opts = {}) ⇒ Array<(GetReports, Fixnum, Hash)>
Get your SMTP activity aggregated per day.
-
#get_smtp_template(template_id, opts = {}) ⇒ GetSmtpTemplateOverview
Returns the template informations.
-
#get_smtp_template_with_http_info(template_id, opts = {}) ⇒ Array<(GetSmtpTemplateOverview, Fixnum, Hash)>
Returns the template informations.
-
#get_smtp_templates(opts = {}) ⇒ GetSmtpTemplates
Get the list of SMTP templates.
-
#get_smtp_templates_with_http_info(opts = {}) ⇒ Array<(GetSmtpTemplates, Fixnum, Hash)>
Get the list of SMTP templates.
-
#initialize(api_client = ApiClient.default) ⇒ SMTPApi
constructor
A new instance of SMTPApi.
-
#send_template(template_id, send_email, opts = {}) ⇒ SendTemplateEmail
Send a template This endpoint is deprecated.
-
#send_template_with_http_info(template_id, send_email, opts = {}) ⇒ Array<(SendTemplateEmail, Fixnum, Hash)>
Send a template This endpoint is deprecated.
-
#send_test_template(template_id, send_test_email, opts = {}) ⇒ nil
Send a template to your test list.
-
#send_test_template_with_http_info(template_id, send_test_email, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Send a template to your test list.
-
#send_transac_email(send_smtp_email, opts = {}) ⇒ CreateSmtpEmail
Send a transactional email.
-
#send_transac_email_with_http_info(send_smtp_email, opts = {}) ⇒ Array<(CreateSmtpEmail, Fixnum, Hash)>
Send a transactional email.
-
#update_smtp_template(template_id, smtp_template, opts = {}) ⇒ nil
Updates an smtp templates.
-
#update_smtp_template_with_http_info(template_id, smtp_template, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Updates an smtp templates.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ SMTPApi
Returns a new instance of SMTPApi.
19 20 21 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_smtp_template(smtp_template, opts = {}) ⇒ CreateModel
Create an smtp template
28 29 30 31 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 28 def create_smtp_template(smtp_template, opts = {}) data, _status_code, _headers = create_smtp_template_with_http_info(smtp_template, opts) return data end |
#create_smtp_template_with_http_info(smtp_template, opts = {}) ⇒ Array<(CreateModel, Fixnum, Hash)>
Create an smtp template
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 38 def create_smtp_template_with_http_info(smtp_template, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SMTPApi.create_smtp_template ..." end # verify the required parameter 'smtp_template' is set if @api_client.config.client_side_validation && smtp_template.nil? fail ArgumentError, "Missing the required parameter 'smtp_template' when calling SMTPApi.create_smtp_template" end # resource path local_var_path = "/smtp/templates" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(smtp_template) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CreateModel') if @api_client.config.debugging @api_client.config.logger.debug "API called: SMTPApi#create_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_hardbounces(opts = {}) ⇒ nil
Delete hardbounces Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures)
83 84 85 86 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 83 def delete_hardbounces(opts = {}) delete_hardbounces_with_http_info(opts) return nil end |
#delete_hardbounces_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete hardbounces Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures)
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 93 def delete_hardbounces_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SMTPApi.delete_hardbounces ..." end # resource path local_var_path = "/smtp/deleteHardbounces" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'delete_hardbounces']) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMTPApi#delete_hardbounces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_smtp_template(template_id, opts = {}) ⇒ nil
Delete an inactive smtp template
133 134 135 136 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 133 def delete_smtp_template(template_id, opts = {}) delete_smtp_template_with_http_info(template_id, opts) return nil end |
#delete_smtp_template_with_http_info(template_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete an inactive smtp template
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 143 def delete_smtp_template_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SMTPApi.delete_smtp_template ..." end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.delete_smtp_template" end # resource path local_var_path = "/smtp/templates/{templateId}".sub('{' + 'templateId' + '}', template_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMTPApi#delete_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_aggregated_smtp_report(opts = {}) ⇒ GetAggregatedReport
Get your SMTP activity aggregated over a period of time
190 191 192 193 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 190 def get_aggregated_smtp_report(opts = {}) data, _status_code, _headers = get_aggregated_smtp_report_with_http_info(opts) return data end |
#get_aggregated_smtp_report_with_http_info(opts = {}) ⇒ Array<(GetAggregatedReport, Fixnum, Hash)>
Get your SMTP activity aggregated over a period of time
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 203 def get_aggregated_smtp_report_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SMTPApi.get_aggregated_smtp_report ..." end # resource path local_var_path = "/smtp/statistics/aggregatedReport" # query parameters query_params = {} query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GetAggregatedReport') if @api_client.config.debugging @api_client.config.logger.debug "API called: SMTPApi#get_aggregated_smtp_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_email_event_report(opts = {}) ⇒ GetEmailEventReport
Get all your SMTP activity (unaggregated events)
257 258 259 260 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 257 def get_email_event_report(opts = {}) data, _status_code, _headers = get_email_event_report_with_http_info(opts) return data end |
#get_email_event_report_with_http_info(opts = {}) ⇒ Array<(GetEmailEventReport, Fixnum, Hash)>
Get all your SMTP activity (unaggregated events)
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 276 def get_email_event_report_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SMTPApi.get_email_event_report ..." end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMTPApi.get_email_event_report, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && opts[:'event'] && !['bounces', 'hardBounces', 'softBounces', 'delivered', 'spam', 'requests', 'opened', 'clicks', 'invalid', 'deferred', 'blocked', 'unsubscribed'].include?(opts[:'event']) fail ArgumentError, 'invalid value for "event", must be one of bounces, hardBounces, softBounces, delivered, spam, requests, opened, clicks, invalid, deferred, blocked, unsubscribed' end # resource path local_var_path = "/smtp/statistics/events" # query parameters query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil? query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil? query_params[:'event'] = opts[:'event'] if !opts[:'event'].nil? query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil? query_params[:'messageId'] = opts[:'message_id'] if !opts[:'message_id'].nil? query_params[:'templateId'] = opts[:'template_id'] if !opts[:'template_id'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GetEmailEventReport') if @api_client.config.debugging @api_client.config.logger.debug "API called: SMTPApi#get_email_event_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_smtp_report(opts = {}) ⇒ GetReports
Get your SMTP activity aggregated per day
339 340 341 342 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 339 def get_smtp_report(opts = {}) data, _status_code, _headers = get_smtp_report_with_http_info(opts) return data end |
#get_smtp_report_with_http_info(opts = {}) ⇒ Array<(GetReports, Fixnum, Hash)>
Get your SMTP activity aggregated per day
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 354 def get_smtp_report_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SMTPApi.get_smtp_report ..." end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMTPApi.get_smtp_report, must be smaller than or equal to 100.' end # resource path local_var_path = "/smtp/statistics/reports" # query parameters query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GetReports') if @api_client.config.debugging @api_client.config.logger.debug "API called: SMTPApi#get_smtp_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_smtp_template(template_id, opts = {}) ⇒ GetSmtpTemplateOverview
Returns the template informations
405 406 407 408 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 405 def get_smtp_template(template_id, opts = {}) data, _status_code, _headers = get_smtp_template_with_http_info(template_id, opts) return data end |
#get_smtp_template_with_http_info(template_id, opts = {}) ⇒ Array<(GetSmtpTemplateOverview, Fixnum, Hash)>
Returns the template informations
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 415 def get_smtp_template_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SMTPApi.get_smtp_template ..." end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.get_smtp_template" end # resource path local_var_path = "/smtp/templates/{templateId}".sub('{' + 'templateId' + '}', template_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GetSmtpTemplateOverview') if @api_client.config.debugging @api_client.config.logger.debug "API called: SMTPApi#get_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_smtp_templates(opts = {}) ⇒ GetSmtpTemplates
Get the list of SMTP templates
462 463 464 465 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 462 def get_smtp_templates(opts = {}) data, _status_code, _headers = get_smtp_templates_with_http_info(opts) return data end |
#get_smtp_templates_with_http_info(opts = {}) ⇒ Array<(GetSmtpTemplates, Fixnum, Hash)>
Get the list of SMTP templates
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 474 def get_smtp_templates_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SMTPApi.get_smtp_templates ..." end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMTPApi.get_smtp_templates, must be smaller than or equal to 1000.' end # resource path local_var_path = "/smtp/templates" # query parameters query_params = {} query_params[:'templateStatus'] = opts[:'template_status'] if !opts[:'template_status'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GetSmtpTemplates') if @api_client.config.debugging @api_client.config.logger.debug "API called: SMTPApi#get_smtp_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#send_template(template_id, send_email, opts = {}) ⇒ SendTemplateEmail
Send a template This endpoint is deprecated. Prefer v3/smtp/email instead.
523 524 525 526 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 523 def send_template(template_id, send_email, opts = {}) data, _status_code, _headers = send_template_with_http_info(template_id, send_email, opts) return data end |
#send_template_with_http_info(template_id, send_email, opts = {}) ⇒ Array<(SendTemplateEmail, Fixnum, Hash)>
Send a template This endpoint is deprecated. Prefer v3/smtp/email instead.
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 534 def send_template_with_http_info(template_id, send_email, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SMTPApi.send_template ..." end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.send_template" end # verify the required parameter 'send_email' is set if @api_client.config.client_side_validation && send_email.nil? fail ArgumentError, "Missing the required parameter 'send_email' when calling SMTPApi.send_template" end # resource path local_var_path = "/smtp/templates/{templateId}/send".sub('{' + 'templateId' + '}', template_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(send_email) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SendTemplateEmail') if @api_client.config.debugging @api_client.config.logger.debug "API called: SMTPApi#send_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#send_test_template(template_id, send_test_email, opts = {}) ⇒ nil
Send a template to your test list
584 585 586 587 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 584 def send_test_template(template_id, send_test_email, opts = {}) send_test_template_with_http_info(template_id, send_test_email, opts) return nil end |
#send_test_template_with_http_info(template_id, send_test_email, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Send a template to your test list
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 595 def send_test_template_with_http_info(template_id, send_test_email, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SMTPApi.send_test_template ..." end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.send_test_template" end # verify the required parameter 'send_test_email' is set if @api_client.config.client_side_validation && send_test_email.nil? fail ArgumentError, "Missing the required parameter 'send_test_email' when calling SMTPApi.send_test_template" end # resource path local_var_path = "/smtp/templates/{templateId}/sendTest".sub('{' + 'templateId' + '}', template_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(send_test_email) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMTPApi#send_test_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#send_transac_email(send_smtp_email, opts = {}) ⇒ CreateSmtpEmail
Send a transactional email
643 644 645 646 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 643 def send_transac_email(send_smtp_email, opts = {}) data, _status_code, _headers = send_transac_email_with_http_info(send_smtp_email, opts) return data end |
#send_transac_email_with_http_info(send_smtp_email, opts = {}) ⇒ Array<(CreateSmtpEmail, Fixnum, Hash)>
Send a transactional email
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 653 def send_transac_email_with_http_info(send_smtp_email, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SMTPApi.send_transac_email ..." end # verify the required parameter 'send_smtp_email' is set if @api_client.config.client_side_validation && send_smtp_email.nil? fail ArgumentError, "Missing the required parameter 'send_smtp_email' when calling SMTPApi.send_transac_email" end # resource path local_var_path = "/smtp/email" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(send_smtp_email) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CreateSmtpEmail') if @api_client.config.debugging @api_client.config.logger.debug "API called: SMTPApi#send_transac_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_smtp_template(template_id, smtp_template, opts = {}) ⇒ nil
Updates an smtp templates
699 700 701 702 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 699 def update_smtp_template(template_id, smtp_template, opts = {}) update_smtp_template_with_http_info(template_id, smtp_template, opts) return nil end |
#update_smtp_template_with_http_info(template_id, smtp_template, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Updates an smtp templates
710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 |
# File 'lib/sib-api-v3-sdk/api/smtp_api.rb', line 710 def update_smtp_template_with_http_info(template_id, smtp_template, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SMTPApi.update_smtp_template ..." end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.update_smtp_template" end # verify the required parameter 'smtp_template' is set if @api_client.config.client_side_validation && smtp_template.nil? fail ArgumentError, "Missing the required parameter 'smtp_template' when calling SMTPApi.update_smtp_template" end # resource path local_var_path = "/smtp/templates/{templateId}".sub('{' + 'templateId' + '}', template_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(smtp_template) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMTPApi#update_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |