lib/ring/sqa/alarm/email.rb in ring-sqa-0.1.11 vs lib/ring/sqa/alarm/email.rb in ring-sqa-0.1.12
- old
+ new
@@ -7,15 +7,16 @@
class Email
SERVER = 'localhost'
def send opts
short, long = opts[:short], opts[:long]
- @from = CFG.email.from
- @to = [CFG.email.to].flatten
- prefix = CFG.email.prefix? ? CFG.email.prefix : ''
- @subject = prefix + short
- @body = long
+ @from = CFG.email.from
+ @to = [CFG.email.to].flatten
+ prefix = CFG.email.prefix? ? CFG.email.prefix : ''
+ @subject = prefix + short
+ @reply_to = CFG.email.reply_to? ? CFG.email.reply_to : @from
+ @body = long
send_email compose_email
rescue => error
Log.error "Email raised '#{error.class}' with message '#{error.message}'"
end
@@ -23,9 +24,10 @@
def compose_email
mail = []
mail << 'From: ' + @from
mail << 'To: ' + @to.join(', ')
+ mail << 'Reply-To: ' + @reply_to
mail << 'Subject: ' + @subject
mail << 'List-Id: ' + 'ring-sqa <sqa.ring.nlnog.net>'
mail << 'X-Mailer: ' + 'ring-sqa'
mail << ''
mail = mail.join("\n")