Class: Smsapipl::SmsTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/smsapipl/sms_template.rb

Class Method Summary collapse

Class Method Details

.send(from: Smsapipl.configuration.from, to:, template:, template_params: {}, optional_params: {}) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/smsapipl/sms_template.rb', line 4

def send(from: Smsapipl.configuration.from, to:, template:, template_params: {}, optional_params:{})
  raise 'Template params keys not in paramX format (X -> 1,2,3,4)' if invalid_template_params?(template_params) 
  params = Smsapipl.configuration.params.merge({from:, to:, template:})
    .merge(optional_params).merge(template_params)

  Client.sms(params:)
end