From 967f42aa98f5bf5994504efee142ed8d4f06465a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 5 Feb 2012 12:57:19 +0000 Subject: Adds a X-Redmine-Sender header to email notifications (#5643). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8785 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/mailer.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/models') diff --git a/app/models/mailer.rb b/app/models/mailer.rb index bd94b9f5b..2502ce2e0 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -41,6 +41,7 @@ class Mailer < ActionMailer::Base 'Issue-Author' => issue.author.login redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to message_id issue + @author = issue.author recipients issue.recipients cc(issue.watcher_recipients - @recipients) subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}" @@ -394,6 +395,10 @@ class Mailer < ActionMailer::Base cc.delete(@author.mail) if cc end + if @author.logged? + redmine_headers 'Sender' => @author.login + end + notified_users = [recipients, cc].flatten.compact.uniq # Rails would log recipients only, not cc and bcc mylogger.info "Sending email notification to: #{notified_users.join(', ')}" if mylogger -- cgit v1.2.3