summaryrefslogtreecommitdiff
path: root/app/mailers/emails
diff options
context:
space:
mode:
authorMario de la Ossa <mariodelaossa@gmail.com>2018-05-03 15:32:20 -0600
committerMario de la Ossa <mariodelaossa@gmail.com>2018-05-07 12:58:47 -0600
commit02741ca4c58c625070d06c248125b2f510ac2c0b (patch)
tree3bfc7684b2082ee73ceffc85868ef3dc2d307a21 /app/mailers/emails
parent33e78f9ebd35b4132e9f18057f517d92cbefb9cd (diff)
downloadgitlab-ce-02741ca4c58c625070d06c248125b2f510ac2c0b.tar.gz
Backport 5480-epic-notifications from EE
Diffstat (limited to 'app/mailers/emails')
-rw-r--r--app/mailers/emails/notes.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/mailers/emails/notes.rb b/app/mailers/emails/notes.rb
index 50e17fe7717..d9a6fe2a41e 100644
--- a/app/mailers/emails/notes.rb
+++ b/app/mailers/emails/notes.rb
@@ -43,7 +43,7 @@ module Emails
private
def note_target_url_options
- [@project, @note.noteable, anchor: "note_#{@note.id}"]
+ [@project || @group, @note.noteable, anchor: "note_#{@note.id}"]
end
def note_thread_options(recipient_id)
@@ -58,8 +58,9 @@ 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)
- if @project && @note.persisted?
+ if (@project || @group) && @note.persisted?
@sent_notification = SentNotification.record_note(@note, recipient_id, reply_key)
end
end