Fix issue due notification emails threading

It should not be a start to a new thread but rather
a reply to an existing thread
This commit is contained in:
Heinrich Lee Yu 2019-08-28 16:17:41 +08:00
parent b34120336d
commit 55d0df7a9f
3 changed files with 22 additions and 1 deletions

View file

@ -11,7 +11,7 @@ module Emails
def issue_due_email(recipient_id, issue_id, reason = nil)
setup_issue_mail(issue_id, recipient_id)
mail_new_thread(@issue, issue_thread_options(@issue.author_id, recipient_id, reason))
mail_answer_thread(@issue, issue_thread_options(@issue.author_id, recipient_id, reason))
end
def new_mention_in_issue_email(recipient_id, issue_id, updated_by_user_id, reason = nil)

View file

@ -0,0 +1,5 @@
---
title: Fix issue due notification emails not being threaded correctly
merge_request: 32325
author:
type: fixed

View file

@ -187,6 +187,22 @@ describe Notify do
end
end
describe 'that are due soon' do
subject { described_class.issue_due_email(recipient.id, issue.id) }
before do
issue.update(due_date: Date.tomorrow)
end
it_behaves_like 'an answer to an existing thread with reply-by-email enabled' do
let(:model) { issue }
end
it_behaves_like 'it should show Gmail Actions View Issue link'
it_behaves_like 'an unsubscribeable thread'
it_behaves_like 'appearance header and footer enabled'
it_behaves_like 'appearance header and footer not enabled'
end
describe 'status changed' do
let(:status) { 'closed' }
subject { described_class.issue_status_changed_email(recipient.id, issue.id, status, current_user.id) }