Class: Cellular::Backends::CoolSMS
- Inherits:
-
Object
- Object
- Cellular::Backends::CoolSMS
- Defined in:
- lib/cellular/backends/cool_sms.rb
Constant Summary collapse
- GATEWAY_URL =
Documentation: www.coolsms.com/support/dokumentation/http-gateway.sms
'https://sms.coolsmsc.dk/'
Class Method Summary collapse
Class Method Details
.deliver(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/cellular/backends/cool_sms.rb', line 10 def self.deliver( = {}) query = { username: Cellular.config.username, password: Cellular.config.password, from: [:sender], to: [:recipient], message: [:message], charset: 'utf-8', resulttype: 'xml', lang: 'en' } result = HTTParty.get(GATEWAY_URL, query: query) response = result.parsed_response['smsc'] [ response['status'], response['result'] || response['message']['result'] ] end |