diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-08-19 10:17:20 -0700 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-08-19 10:17:20 -0700 |
commit | 4f34d363a532613df60f3e566644c082ed3fa395 (patch) | |
tree | 3ba8d3624b3e448ccbcee340a86d496b9948333e /app/mailers | |
parent | 73eef57d5e3dfc4a60e3e661c04a9172b94f1535 (diff) | |
download | gitlab-ce-4f34d363a532613df60f3e566644c082ed3fa395.tar.gz |
Correctly set Message-ID for comment notifications.
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/notify.rb | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index c2ea99d9688..e893009c728 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -129,11 +129,7 @@ class Notify < ActionMailer::Base "<#{model_name}_#{model.id}@#{Gitlab.config.gitlab.host}>" end - # Send an email that starts a new conversation thread, - # with headers suitable for grouping by thread in email clients. - # - # See: mail_answer_thread - def mail_new_thread(model, headers = {}) + def mail_thread(model, headers = {}) if @project headers['X-GitLab-Project'] = @project.name headers['X-GitLab-Project-Id'] = @project.id @@ -142,8 +138,6 @@ class Notify < ActionMailer::Base headers["X-GitLab-#{model.class.name}-ID"] = model.id - headers['Message-ID'] = message_id(model) - if reply_key headers['X-GitLab-Reply-Key'] = reply_key headers['Reply-To'] = Gitlab::ReplyByEmail.reply_address(reply_key) @@ -152,6 +146,16 @@ class Notify < ActionMailer::Base mail(headers) end + # Send an email that starts a new conversation thread, + # with headers suitable for grouping by thread in email clients. + # + # See: mail_answer_thread + def mail_new_thread(model, headers = {}) + headers['Message-ID'] = message_id(model) + + mail_thread(model, headers) + end + # Send an email that responds to an existing conversation thread, # with headers suitable for grouping by thread in email clients. # @@ -165,11 +169,9 @@ class Notify < ActionMailer::Base headers['In-Reply-To'] = message_id(model) headers['References'] = message_id(model) - if headers[:subject] - headers[:subject].prepend('Re: ') - end + headers[:subject].prepend('Re: ') if headers[:subject] - mail_new_thread(model, headers) + mail_thread(model, headers) end def can? |