Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
iwarshak committed Jan 11, 2011
1 parent 249b8d1 commit 66758c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/moonshadosms/sender.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def status(moonshado_claimcheck)
end

def deliver(message, recipients = [])
require 'rubygems'; require 'ruby-debug'; debugger
text = prepare_text(message)
send_time = Time.now
recipients.each do |recipient|
Expand All @@ -42,7 +43,7 @@ def deliver(message, recipients = [])
begin
response = RestClient.post "https://#{API_ENDPOINT}/gateway/sms", d
code = Crack::XML.parse(response)["status"]["code"] rescue nil
info = Crack::XML.parse(response)["status"]["info"] rescue nil
info = Crack::XML.parse(response)["status"]["info"] rescue nil
if code == "10"
logger.info("response #{response}") if logger
logger.info("Sent #{message} to #{recipient} Info: #{info}") if logger
Expand All @@ -56,6 +57,8 @@ def deliver(message, recipients = [])
error_callback.call("Error in Moonshado SMS. #{error_str}") if error_callback
end
rescue => ex
require 'rubygems'; require 'ruby-debug'; debugger

if response && response.respond_to?(:body)
response_string = "#{response.body}\n#{d}\n#{ex.inspect}"
else
Expand Down

0 comments on commit 66758c8

Please sign in to comment.