class SibApiV3Sdk::TransactionalEmailsApi
Attributes
Public Class Methods
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Add a new domain to the list of blocked domains Blocks a new domain in order to avoid messages being sent to the same @param block_domain @param [Hash] opts the optional parameters @return [nil]
# File lib/sib-api-v3-sdk/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
Add a new domain to the list of blocked domains Blocks a new domain in order to avoid messages being sent to the same @param block_domain @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/sib-api-v3-sdk/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 an email template @param smtp_template values to update in transactional email template @param [Hash] opts the optional parameters @return [CreateModel]
# File lib/sib-api-v3-sdk/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 an email template @param smtp_template values to update in transactional email template @param [Hash] opts the optional parameters @return [Array<(CreateModel
, Fixnum, Hash)>] CreateModel
data, response status code and response headers
# File lib/sib-api-v3-sdk/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
Unblock an existing domain from the list of blocked domains Unblocks an existing domain from the list of blocked domains @param domain The name of the domain to be deleted @param [Hash] opts the optional parameters @return [nil]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 142 def delete_blocked_domain(domain, opts = {}) delete_blocked_domain_with_http_info(domain, opts) nil end
Unblock an existing domain from the list of blocked domains Unblocks an existing domain from the list of blocked domains @param domain The name of the domain to be deleted @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/sib-api-v3-sdk/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 Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) @param [Hash] opts the optional parameters @option opts [DeleteHardbounces] :delete_hardbounces values to delete hardbounces @return [nil]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 195 def delete_hardbounces(opts = {}) delete_hardbounces_with_http_info(opts) nil end
Delete hardbounces Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) @param [Hash] opts the optional parameters @option opts [DeleteHardbounces] :delete_hardbounces values to delete hardbounces @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/sib-api-v3-sdk/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 an inactive email template @param template_id id of the template @param [Hash] opts the optional parameters @return [nil]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 243 def delete_smtp_template(template_id, opts = {}) delete_smtp_template_with_http_info(template_id, opts) nil end
Delete an inactive email template @param template_id id of the template @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 252 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 your transactional email activity aggregated over a period of time @param [Hash] opts the optional parameters @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' @option opts [String] :tag Tag of the emails @return [GetAggregatedReport]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 297 def get_aggregated_smtp_report(opts = {}) data, _status_code, _headers = get_aggregated_smtp_report_with_http_info(opts) data end
Get your transactional email activity aggregated over a period of time @param [Hash] opts the optional parameters @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' @option opts [String] :tag Tag of the emails @return [Array<(GetAggregatedReport
, Fixnum, Hash)>] GetAggregatedReport
data, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 309 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 the list of blocked domains Get the list of blocked domains @param [Hash] opts the optional parameters @return [GetBlockedDomains]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 352 def get_blocked_domains(opts = {}) data, _status_code, _headers = get_blocked_domains_with_http_info(opts) data end
Get the list of blocked domains Get the list of blocked domains @param [Hash] opts the optional parameters @return [Array<(GetBlockedDomains
, Fixnum, Hash)>] GetBlockedDomains
data, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 361 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 all your transactional email activity (unaggregated events) @param [Hash] opts the optional parameters @option opts [Integer] :limit Number limitation for the result returned (default to 50) @option opts [Integer] :offset Beginning point in the list to retrieve from. (default to 0) @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' @option opts [String] :email Filter the report for a specific email addresses @option opts [String] :event Filter the report for a specific event type @option opts [String] :tags Filter the report for tags (serialized and urlencoded array) @option opts [String] :message_id Filter on a specific message id @option opts [Integer] :template_id Filter on a specific template id @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed (default to desc) @return [GetEmailEventReport]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 410 def get_email_event_report(opts = {}) data, _status_code, _headers = get_email_event_report_with_http_info(opts) data end
Get all your transactional email activity (unaggregated events) @param [Hash] opts the optional parameters @option opts [Integer] :limit Number limitation for the result returned @option opts [Integer] :offset Beginning point in the list to retrieve from. @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' @option opts [String] :email Filter the report for a specific email addresses @option opts [String] :event Filter the report for a specific event type @option opts [String] :tags Filter the report for tags (serialized and urlencoded array) @option opts [String] :message_id Filter on a specific message id @option opts [Integer] :template_id Filter on a specific template id @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed @return [Array<(GetEmailEventReport
, Fixnum, Hash)>] GetEmailEventReport
data, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 429 def get_email_event_report_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_email_event_report ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_email_event_report, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && opts[:'event'] && !['bounces', 'hardBounces', 'softBounces', 'delivered', 'spam', 'requests', 'opened', 'clicks', 'invalid', 'deferred', 'blocked', 'unsubscribed', 'error'].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' 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 your transactional email activity aggregated per day @param [Hash] opts the optional parameters @option opts [Integer] :limit Number of documents returned per page (default to 10) @option opts [Integer] :offset Index of the first document on the page (default to 0) @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' @option opts [String] :tag Tag of the emails @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed (default to desc) @return [GetReports]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 495 def get_smtp_report(opts = {}) data, _status_code, _headers = get_smtp_report_with_http_info(opts) data end
Get your transactional email activity aggregated per day @param [Hash] opts the optional parameters @option opts [Integer] :limit Number of documents returned per page @option opts [Integer] :offset Index of the first document on the page @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' @option opts [String] :tag Tag of the emails @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed @return [Array<(GetReports
, Fixnum, Hash)>] GetReports
data, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 510 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[:'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
Returns the template information @param template_id id of the template @param [Hash] opts the optional parameters @return [GetSmtpTemplateOverview]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 563 def get_smtp_template(template_id, opts = {}) data, _status_code, _headers = get_smtp_template_with_http_info(template_id, opts) data end
Returns the template information @param template_id id of the template @param [Hash] opts the optional parameters @return [Array<(GetSmtpTemplateOverview
, Fixnum, Hash)>] GetSmtpTemplateOverview
data, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 572 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 the list of email templates @param [Hash] opts the optional parameters @option opts [BOOLEAN] :template_status Filter on the status of the template. Active = true, inactive = false @option opts [Integer] :limit Number of documents returned per page (default to 50) @option opts [Integer] :offset Index of the first document in the page (default to 0) @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed (default to desc) @return [GetSmtpTemplates]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 618 def get_smtp_templates(opts = {}) data, _status_code, _headers = get_smtp_templates_with_http_info(opts) data end
Get the list of email templates @param [Hash] opts the optional parameters @option opts [BOOLEAN] :template_status Filter on the status of the template. Active = true, inactive = false @option opts [Integer] :limit Number of documents returned per page @option opts [Integer] :offset Index of the first document in the page @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed @return [Array<(GetSmtpTemplates
, Fixnum, Hash)>] GetSmtpTemplates
data, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 630 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[:'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 the list of blocked or unsubscribed transactional contacts @param [Hash] opts the optional parameters @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts @option opts [String] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts @option opts [Integer] :limit Number of documents returned per page (default to 50) @option opts [Integer] :offset Index of the first document on the page (default to 0) @option opts [Array<String>] :senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed (default to desc) @return [GetTransacBlockedContacts]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 685 def get_transac_blocked_contacts(opts = {}) data, _status_code, _headers = get_transac_blocked_contacts_with_http_info(opts) data end
Get the list of blocked or unsubscribed transactional contacts @param [Hash] opts the optional parameters @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts @option opts [String] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts @option opts [Integer] :limit Number of documents returned per page @option opts [Integer] :offset Index of the first document on the page @option opts [Array<String>] :senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed @return [Array<(GetTransacBlockedContacts
, Fixnum, Hash)>] GetTransacBlockedContacts
data, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 699 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[:'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 the personalized content of a sent transactional email @param uuid Unique id of the transactional email that has been sent to a particular contact @param [Hash] opts the optional parameters @return [GetTransacEmailContent]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 751 def get_transac_email_content(uuid, opts = {}) data, _status_code, _headers = get_transac_email_content_with_http_info(uuid, opts) data end
Get the personalized content of a sent transactional email @param uuid Unique id of the transactional email that has been sent to a particular contact @param [Hash] opts the optional parameters @return [Array<(GetTransacEmailContent
, Fixnum, Hash)>] GetTransacEmailContent
data, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 760 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 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. @param [Hash] opts the optional parameters @option opts [String] :email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. @option opts [Integer] :template_id Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. @option opts [String] :message_id Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. @option opts [String] :end_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. @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed (default to desc) @option opts [Integer] :limit Number of documents returned per page (default to 500) @option opts [Integer] :offset Index of the first document in the page (default to 0) @return [GetTransacEmailsList]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 811 def get_transac_emails_list(opts = {}) data, _status_code, _headers = get_transac_emails_list_with_http_info(opts) data end
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. @param [Hash] opts the optional parameters @option opts [String] :email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. @option opts [Integer] :template_id Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. @option opts [String] :message_id Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. @option opts [String] :end_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. @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed @option opts [Integer] :limit Number of documents returned per page @option opts [Integer] :offset Index of the first document in the page @return [Array<(GetTransacEmailsList
, Fixnum, Hash)>] GetTransacEmailsList
data, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 828 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 # 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 a template This endpoint is deprecated. Prefer v3/smtp/email instead. @param template_id Id of the template @param send_email @param [Hash] opts the optional parameters @return [SendTemplateEmail]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 884 def send_template(template_id, send_email, opts = {}) data, _status_code, _headers = send_template_with_http_info(template_id, send_email, opts) data end
Send a template This endpoint is deprecated. Prefer v3/smtp/email instead. @param template_id Id of the template @param send_email @param [Hash] opts the optional parameters @return [Array<(SendTemplateEmail
, Fixnum, Hash)>] SendTemplateEmail
data, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 895 def send_template_with_http_info(template_id, send_email, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.send_template ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling TransactionalEmailsApi.send_template" end # verify the required parameter 'send_email' is set if @api_client.config.client_side_validation && send_email.nil? fail ArgumentError, "Missing the required parameter 'send_email' when calling TransactionalEmailsApi.send_template" end # resource path local_var_path = '/smtp/templates/{templateId}/send'.sub('{' + 'templateId' + '}', template_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(send_email) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SendTemplateEmail') if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#send_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Send a template to your test list @param template_id Id of the template @param send_test_email @param [Hash] opts the optional parameters @return [nil]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 943 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 a template to your test list @param template_id Id of the template @param send_test_email @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 953 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 a transactional email @param send_smtp_email Values to send a transactional email @param [Hash] opts the optional parameters @return [CreateSmtpEmail]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 999 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 a transactional email @param send_smtp_email Values to send a transactional email @param [Hash] opts the optional parameters @return [Array<(CreateSmtpEmail
, Fixnum, Hash)>] CreateSmtpEmail
data, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 1008 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
Set custom user_agent if explicitly passed in api default will still remain Swagger-Codegen/#{VERSION}/ruby
# File lib/sib-api-v3-sdk/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?('sendinblue_') @api_client.default_headers['User-Agent'] = @user_agent end end
Unblock or resubscribe a transactional contact @param email contact email (urlencoded) to unblock. @param [Hash] opts the optional parameters @return [nil]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 1051 def smtp_blocked_contacts_email_delete(email, opts = {}) smtp_blocked_contacts_email_delete_with_http_info(email, opts) nil end
Unblock or resubscribe a transactional contact @param email contact email (urlencoded) to unblock. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 1060 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
Delete an SMTP transactional log @param message_id MessageId of the transactional log to delete @param [Hash] opts the optional parameters @return [nil]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 1102 def smtp_log_message_id_delete(message_id, opts = {}) smtp_log_message_id_delete_with_http_info(message_id, opts) nil end
Delete an SMTP transactional log @param message_id MessageId of the transactional log to delete @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 1111 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 an email template @param template_id id of the template @param smtp_template values to update in transactional email template @param [Hash] opts the optional parameters @return [nil]
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 1154 def update_smtp_template(template_id, smtp_template, opts = {}) update_smtp_template_with_http_info(template_id, smtp_template, opts) nil end
Update an email template @param template_id id of the template @param smtp_template values to update in transactional email template @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/sib-api-v3-sdk/api/transactional_emails_api.rb, line 1164 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