From f55aaca561986757343fb410a9e6c09cfcc61385 Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Fri, 8 Dec 2017 22:45:57 +0100 Subject: Make discussion mail References all notes in the discussion 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. --- app/mailers/notify.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/mailers/notify.rb') 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 = "".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? -- cgit v1.2.3