From: Go MAEDA Date: Sat, 13 May 2023 08:05:32 +0000 (+0000) Subject: Add X-Redmine-Issue-Priority headers to issue notification mails (#2746). X-Git-Tag: 5.1.0~126 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9d0b073f7d4428a7f4525cd498bb06890df2ffb7;p=redmine.git Add X-Redmine-Issue-Priority headers to issue notification mails (#2746). Patch by Holger Just. git-svn-id: https://svn.redmine.org/redmine/trunk@22244 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 3b29aed7b..558c280ec 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -76,6 +76,7 @@ class Mailer < ActionMailer::Base 'Issue-Id' => issue.id, 'Issue-Author' => issue.author.login, 'Issue-Assignee' => assignee_for_header(issue) + redmine_headers 'Issue-Priority' => issue.priority.name if issue.priority message_id issue references issue @author = issue.author @@ -108,6 +109,7 @@ class Mailer < ActionMailer::Base 'Issue-Id' => issue.id, 'Issue-Author' => issue.author.login, 'Issue-Assignee' => assignee_for_header(issue) + redmine_headers 'Issue-Priority' => issue.priority.name if issue.priority message_id journal references issue @author = journal.user diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index 07b7d27ae..ee029d3e6 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -210,6 +210,7 @@ class MailerTest < ActiveSupport::TestCase # List-Id should not include the display name "Redmine" assert_equal '', mail.header['List-Id'].to_s assert_equal 'Bug', mail.header['X-Redmine-Issue-Tracker'].to_s + assert_equal 'Low', mail.header['X-Redmine-Issue-Priority'].to_s end def test_email_headers_should_include_sender