# # Copyright (C) 2007 Mobio Networks, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # #require 'drivers' class Messaging < Mobio::WebServices::WsdlDriver def send_email(to, from, subject, body) begin res = self.class.driver.sendEmail :toAddress => to, :fromAddress => from, :subject => subject, :body => body unless res.result.xmlattr_nil == 'true' false else true end rescue SOAP::FaultError false end end def get_country_names begin res = self.class.driver.getCountryNames true #not sure if we need to pass it true... res.countryNames.string rescue SOAP::FaultError false end end def get_carriers_for_country(country) begin res = self.class.driver.getCarriersForCountry :countryName => country if res.carrierNames.respond_to? :string res.carrierNames.string else nil end rescue SOAP::FaultError false end end def get_carrier_names begin res = self.class.driver.getCarrierNames if res.carrierNames.respond_to? :string res.carrierNames.string else nil end rescue SOAP::FaultError false end end # to be finished def bulk_sms end def self.send_sms(countryName, phoneNumber, carrier, text, from) res = self.driver.sendSMS :countryName => countryName, :phoneNumber => phoneNumber, :carrier => carrier, :text => text, :from => from end end