aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/notifiers/sms_aql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mauve/notifiers/sms_aql.rb')
-rw-r--r--lib/mauve/notifiers/sms_aql.rb19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/mauve/notifiers/sms_aql.rb b/lib/mauve/notifiers/sms_aql.rb
index 856c494..b295e6c 100644
--- a/lib/mauve/notifiers/sms_aql.rb
+++ b/lib/mauve/notifiers/sms_aql.rb
@@ -41,12 +41,19 @@ module Mauve
'Content-Length' => opts_string.length.to_s
})
- raise response unless response.kind_of?(Net::HTTPSuccess)
-
- #
- # Woo -- return true!
- #
- true
+ history = Mauve::History.new(:alert => alert, :type => :notification)
+ if response.kind_of?(Net::HTTPSuccess)
+ history.event = "Sent SMS via AQL to #{destination}"
+ history.save
+ #
+ # Woo -- return true!
+ #
+ true
+ else
+ history.event = "Failed to send SMS via AQL to #{destination} due to #{response.class.to_s}"
+ history.save
+ false
+ end
end
protected