diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-17 09:09:10 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-17 09:09:10 +0100 |
commit | 0dcb2755a2a68d447c8faf673db3bbe73caa12a8 (patch) | |
tree | 19d04981abfb4160f383212d7ed957aea456ddcb | |
parent | c50972e379859bffc30f8676192986e28840b107 (diff) |
Updated sms notifier.
-rw-r--r-- | lib/mauve/notifiers/sms_aql.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/mauve/notifiers/sms_aql.rb b/lib/mauve/notifiers/sms_aql.rb index 1cf8c04..c1c356b 100644 --- a/lib/mauve/notifiers/sms_aql.rb +++ b/lib/mauve/notifiers/sms_aql.rb @@ -57,9 +57,15 @@ module Mauve "" end - txt += "#{alert.update_type.upcase}: " - txt += alert.summary_one_line - + template_file = File.join(File.dirname(__FILE__),"templates","sms.txt.erb") + + txt += if File.exists?(template_file) + ERB.new(File.read(template_file)).result(binding).chomp + else + logger.error("Could not find sms.txt.erb template") + alert.to_s + end + others = all_alerts-[alert] if !others.empty? txt += (1 == others.length)? |