diff options
author | Toon Claes <toon@iotcl.com> | 2017-09-15 09:58:21 +0300 |
---|---|---|
committer | Toon Claes <toon@iotcl.com> | 2017-12-13 23:26:01 +0300 |
commit | 2acf3a564c4d042b4cf5463867bd5d37723509f5 (patch) | |
tree | 76be3f9413422d7444f58b3750e10e0677d94ec7 /app/mailers/notify.rb | |
parent | 43b98944fb34d1a3ca37ae598327e4575d2ec315 (diff) |
Make mail notifications of discussion notes In-Reply-To of each other
When a note is part of a discussion, the email sent out should be
`In-Reply-To` the previous note in that discussion.
Closes gitlab-org/gitlab-ce#36054
Diffstat (limited to 'app/mailers/notify.rb')
-rw-r--r-- | app/mailers/notify.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 9efabe3f44e..250583d2d28 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -156,6 +156,18 @@ class Notify < BaseMailer mail_thread(model, headers) end + 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['X-GitLab-Discussion-ID'] = note.discussion.id if note.part_of_discussion? + + headers[:subject]&.prepend('Re: ') + + mail_thread(model, headers) + end + def reply_key @reply_key ||= SentNotification.reply_key end |