Commit 621c6b8533b527c735bb90c0a49ed18f55af93fa

Authored by Riyad Preukschas
1 parent 7335f366

Fix commit note notification

app/mailers/notify.rb
@@ -62,12 +62,12 @@ class Notify < ActionMailer::Base @@ -62,12 +62,12 @@ class Notify < ActionMailer::Base
62 # Note 62 # Note
63 # 63 #
64 64
65 - def note_commit_email(recipient_id, note_id) 65 + def note_commit_email(commit_autor_email, note_id)
66 @note = Note.find(note_id) 66 @note = Note.find(note_id)
67 @commit = @note.noteable 67 @commit = @note.noteable
68 @commit = CommitDecorator.decorate(@commit) 68 @commit = CommitDecorator.decorate(@commit)
69 @project = @note.project 69 @project = @note.project
70 - mail(to: recipient(recipient_id), subject: subject("note for commit #{@commit.short_id}", @commit.title)) 70 + mail(to: recipient(commit_autor_email), subject: subject("note for commit #{@commit.short_id}", @commit.title))
71 end 71 end
72 72
73 def note_issue_email(recipient_id, note_id) 73 def note_issue_email(recipient_id, note_id)
app/observers/note_observer.rb
@@ -11,7 +11,7 @@ class NoteObserver < ActiveRecord::Observer @@ -11,7 +11,7 @@ class NoteObserver < ActiveRecord::Observer
11 notify_team(note) 11 notify_team(note)
12 elsif note.notify_author 12 elsif note.notify_author
13 # Notify only author of resource 13 # Notify only author of resource
14 - Notify.note_commit_email(note.commit_author.id, note.id).deliver 14 + Notify.note_commit_email(note.noteable.author_email, note.id).deliver
15 else 15 else
16 # Otherwise ignore it 16 # Otherwise ignore it
17 nil 17 nil