Module: TelcosmsModule

Included in:
Telcosms
Defined in:
lib/telcosms_module.rb,
lib/telcosms/version.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

VERSION =
"1.1.0"

Instance Method Summary collapse

Instance Method Details

#send(number:, message:, service:) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/telcosms_module.rb', line 8

def send(number:, message:, service:)
  conn = connection
  conn.post("#{host}/api") do |req|
    req.params[:action] = 'sendmessage'
    req.params[:username] = @username
    req.params[:password] = @password
    req.params[:recipient] = number 
    req.params[:messagetype] = 'SMS:TEXT'
    req.params[:messagedata] = message
    req.params[:originator] = service
  end
end