Commit 96703395 authored by Sean McGivern's avatar Sean McGivern

Merge branch...

Merge branch '329366-do-not-send-emails-to-customers-for-confidential-service-desk-comments' into 'master'

Don't email issue email participants confidential comments

See merge request gitlab-org/gitlab!60594
parents 439dd31c 78768f5b
......@@ -384,6 +384,7 @@ class NotificationService
def send_service_desk_notification(note)
return unless note.noteable_type == 'Issue'
return if note.confidential
issue = note.noteable
recipients = issue.email_participants_emails
......
---
title: Don't email issue email participants confidential comments
merge_request: 60594
author: Lee Tickett @leetickett
type: fixed
......@@ -412,7 +412,7 @@ RSpec.describe NotificationService, :mailer do
it_should_not_email!
end
context 'do exist' do
context 'do exist and note not confidential' do
let!(:issue_email_participant) { issue.issue_email_participants.create!(email: 'service.desk@example.com') }
before do
......@@ -422,6 +422,18 @@ RSpec.describe NotificationService, :mailer do
it_should_email!
end
context 'do exist and note is confidential' do
let(:note) { create(:note, noteable: issue, project: project, confidential: true) }
let!(:issue_email_participant) { issue.issue_email_participants.create!(email: 'service.desk@example.com') }
before do
issue.update!(external_author: 'service.desk@example.com')
project.update!(service_desk_enabled: true)
end
it_should_not_email!
end
end
describe '#new_note' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment