diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-08-04 16:11:37 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-08-04 16:11:37 +0100 |
commit | 6fbd9fcae218b675b298d7b4101e2f184e56818c (patch) | |
tree | f04f0aa7266711c40b65ad60f29a106747c05202 /lib/mauve/notifiers | |
parent | b3a4345e1359f77011bd312b1afeed8eb2b97c91 (diff) |
Updated pop3 server to be configurable
Diffstat (limited to 'lib/mauve/notifiers')
-rw-r--r-- | lib/mauve/notifiers/email.rb | 11 | ||||
-rw-r--r-- | lib/mauve/notifiers/templates/email.html.erb | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/mauve/notifiers/email.rb b/lib/mauve/notifiers/email.rb index 03384f7..8f2d32b 100644 --- a/lib/mauve/notifiers/email.rb +++ b/lib/mauve/notifiers/email.rb @@ -24,7 +24,6 @@ module Mauve @password = nil @login_method = nil @from = "mauve@localhost" - @hostname = "localhost" @signature = "This is an automatic mailing, please do not reply." @subject_prefix = "" end @@ -73,7 +72,15 @@ module Mauve m.header.to = destination m.header.from = @from - m.header.date = alert.updated_at.to_time || MauveTime.now + m.header.date = case alert.update_type + when "cleared" + alert.cleared_at + when "acknowledged" + alert.acknowledged_at + else + alert.raised_at + end + m.header['Content-Type'] = "multipart/alternative" txt_template = File.join(File.dirname(__FILE__), "templates", "email.txt.erb") diff --git a/lib/mauve/notifiers/templates/email.html.erb b/lib/mauve/notifiers/templates/email.html.erb index 24b5e7b..fb33de6 100644 --- a/lib/mauve/notifiers/templates/email.html.erb +++ b/lib/mauve/notifiers/templates/email.html.erb @@ -1,7 +1,7 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body> -<p><a href="<%= WebInterface.url_for(alert) %>"><%= alert.update_type.upcase %></a>:<% +<p><a href="<%= WebInterface.url_for(alert) %>"><%= alert.update_type.upcase %></a>: <% case alert.update_type when "cleared" %><%= alert.cleared_at.to_s_relative %><% |