summaryrefslogtreecommitdiff
path: root/app/mailers/notify.rb
diff options
context:
space:
mode:
authorToon Claes <toon@iotcl.com>2017-12-08 22:45:57 +0100
committerToon Claes <toon@iotcl.com>2017-12-13 21:26:01 +0100
commitf55aaca561986757343fb410a9e6c09cfcc61385 (patch)
tree1c84b54d8cefa3af4768af4cf31740107f188cb2 /app/mailers/notify.rb
parent2acf3a564c4d042b4cf5463867bd5d37723509f5 (diff)
downloadgitlab-ce-f55aaca561986757343fb410a9e6c09cfcc61385.tar.gz
Make discussion mail References all notes in the discussiontc-correct-email-in-reply-to
When a note is part of a discussion, the email sent out will be `In-Reply-To` the previous note in that discussion. It also `References` all the previous notes in that discussion, and the original issue. Closes gitlab-org/gitlab-ce#36054.
Diffstat (limited to 'app/mailers/notify.rb')
-rw-r--r--app/mailers/notify.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index 250583d2d28..ec886e993c3 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -119,8 +119,8 @@ class Notify < BaseMailer
headers['Reply-To'] = address
fallback_reply_message_id = "<reply-#{reply_key}@#{Gitlab.config.gitlab.host}>".freeze
- headers['References'] ||= ''
- headers['References'] << ' ' << fallback_reply_message_id
+ headers['References'] ||= []
+ headers['References'] << fallback_reply_message_id
@reply_by_email = true
end
@@ -158,8 +158,8 @@ class Notify < BaseMailer
def mail_answer_note_thread(model, note, headers = {})
headers['Message-ID'] = message_id(note)
- headers['In-Reply-To'] = message_id(note.replies_to)
- headers['References'] = message_id(model)
+ headers['In-Reply-To'] = message_id(note.references.last)
+ headers['References'] = note.references.map { |ref| message_id(ref) }
headers['X-GitLab-Discussion-ID'] = note.discussion.id if note.part_of_discussion?