summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-05 12:57:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-05 12:57:19 +0000
commit967f42aa98f5bf5994504efee142ed8d4f06465a (patch)
tree4613da3827a33395a8a799667c1d3b94a5d49e44 /app/models
parentf52f18c2814b0bf71a719e17f2338a43966cfcb8 (diff)
downloadredmine-967f42aa98f5bf5994504efee142ed8d4f06465a.tar.gz
redmine-967f42aa98f5bf5994504efee142ed8d4f06465a.zip
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
Diffstat (limited to 'app/models')
-rw-r--r--app/models/mailer.rb5
1 files changed, 5 insertions, 0 deletions
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