summaryrefslogtreecommitdiff
path: root/app/mailers/emails
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-06-24 09:20:10 +0000
committerDouwe Maan <douwe@gitlab.com>2019-06-24 09:20:10 +0000
commite6532ca203a9f29294ebbc854e7c6372f76799dd (patch)
treea610b009356413d1a9ade1402c3b902186d26e07 /app/mailers/emails
parent6177bc1d69ca4870672a9db1af3b5f6798674676 (diff)
downloadgitlab-ce-e6532ca203a9f29294ebbc854e7c6372f76799dd.tar.gz
Fix notes email with group-level notification email
A Noteable doesn't have a group directly, unless it's an epic - we need to look for the project's group to find the right email address.
Diffstat (limited to 'app/mailers/emails')
-rw-r--r--app/mailers/emails/notes.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/mailers/emails/notes.rb b/app/mailers/emails/notes.rb
index 70d296fe3b8..506c8d251b7 100644
--- a/app/mailers/emails/notes.rb
+++ b/app/mailers/emails/notes.rb
@@ -60,7 +60,7 @@ module Emails
# `note_id` is a `Note` when originating in `NotifyPreview`
@note = note_id.is_a?(Note) ? note_id : Note.find(note_id)
@project = @note.project
- @group = @note.noteable.try(:group)
+ @group = @project.try(:group) || @note.noteable.try(:group)
if (@project || @group) && @note.persisted?
@sent_notification = SentNotification.record_note(@note, recipient_id, reply_key)