Module: Wesender

Includes:
HTTParty
Included in:
WesenderSMS
Defined in:
lib/wesender.rb,
lib/wesender/version.rb

Constant Summary collapse

VERSION =
"0.0.3"

Instance Method Summary collapse

Instance Method Details

#send(numbers, message, hasSpecialCharacter = false, options = {}) ⇒ Object



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

def send(numbers, message, hasSpecialCharacter = false, options = {})
  @url = 'https://api.wesender.co.ao'

  response = HTTParty.post("#{@url}/envio/apikey", 
    :body => { 
      :ApiKey => @api_key, 
      :Destino => numbers, 
      :Mensagem => message, 
      :CEspecial => hasSpecialCharacter 
    }.to_json,
    :headers => { 'Content-Type' => 'application/json' } 
  )
  response.parsed_response
end