Sha256: 615037a6ba75c8a7bf364b221e18fb56e5291c3428b08649546bc0d4d040639e
Contents?: true
Size: 798 Bytes
Versions: 10
Compression:
Stored size: 798 Bytes
Contents
module ErpTechSvcs module SmsWrapper class Clickatell attr_accessor :api def initialize() configuration = YAML::load_file(File.join(Rails.root,'config','clickatell.yml'))[Rails.env] @api = ::Clickatell::API.authenticate(configuration['api_id'].to_s, configuration['username'], configuration['password']) end def send_message(phone_number, message, options={}) phone_number = phone_number.insert(0,'1') if phone_number.length == 10 result = nil begin result = @api.send_message(phone_number, message, options) rescue ::Clickatell::API::Error=>ex Rails.logger.error("Clickatell Error:#{ex.message}") end result end end #Clickatell end #SmsWrapper end #ErpTechSvcs
Version data entries
10 entries across 10 versions & 1 rubygems