Skip to content

Instantly share code, notes, and snippets.

@fguillen
Created May 2, 2011 11:00
Show Gist options
  • Save fguillen/951439 to your computer and use it in GitHub Desktop.
Save fguillen/951439 to your computer and use it in GitHub Desktop.
sending SMS by OVH
require 'soap/wsdlDriver'
class SMSSender
def self.send( phone, text )
Rails.logger.info( "sending sms [#{phone}]: '#{text}'")
wsdl = 'http://www.ovh.com/soapi/soapi-re-1.18.wsdl'
soapi = SOAP::WSDLDriverFactory.new( wsdl ).create_rpc_driver
session =
soapi.login(
APP_CONFIG[:sms_user],
APP_CONFIG[:sms_pass],
'es',
false
)
result =
soapi.telephonySmsSend(
session,
APP_CONFIG[:sms_pack],
APP_CONFIG[:sms_phone_from],
phone,
text,
nil,
nil,
nil,
nil,
nil,
nil
)
soapi.logout( session )
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment