lib/flapjack/gateways/sms_messagenet.rb in flapjack-0.8.5 vs lib/flapjack/gateways/sms_messagenet.rb in flapjack-0.8.6
- old
+ new
@@ -32,10 +32,15 @@
address = alert.address
notification_id = alert.notification_id
message_type = alert.rollup ? 'rollup' : 'alert'
my_dir = File.dirname(__FILE__)
- sms_template_path = my_dir + "/sms_messagenet/#{message_type}.text.erb"
+ sms_template_path = case
+ when @config.has_key?('templates') && @config['templates']["#{message_type}.text"]
+ @config['templates']["#{message_type}.text"]
+ else
+ my_dir + "/sms_messagenet/#{message_type}.text.erb"
+ end
sms_template = ERB.new(File.read(sms_template_path), nil, '-')
@alert = alert
bnd = binding