From e6532ca203a9f29294ebbc854e7c6372f76799dd Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Mon, 24 Jun 2019 09:20:10 +0000 Subject: 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. --- app/mailers/emails/notes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/mailers') 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) -- cgit v1.2.3