Commit cc2484c3e61764adbb61d78c97148c41cf346cd1
1 parent
5857a7a9
Exists in
master
and in
4 other branches
Fix sending commit note email to id instead email
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
app/mailers/notify.rb
@@ -63,12 +63,12 @@ class Notify < ActionMailer::Base | @@ -63,12 +63,12 @@ class Notify < ActionMailer::Base | ||
63 | # Note | 63 | # Note |
64 | # | 64 | # |
65 | 65 | ||
66 | - def note_commit_email(commit_autor_email, note_id) | 66 | + def note_commit_email(recipient_id, note_id) |
67 | @note = Note.find(note_id) | 67 | @note = Note.find(note_id) |
68 | @commit = @note.noteable | 68 | @commit = @note.noteable |
69 | @commit = CommitDecorator.decorate(@commit) | 69 | @commit = CommitDecorator.decorate(@commit) |
70 | @project = @note.project | 70 | @project = @note.project |
71 | - mail(to: commit_autor_email, subject: subject("note for commit #{@commit.short_id}", @commit.title)) | 71 | + mail(to: recipient(recipient_id), subject: subject("note for commit #{@commit.short_id}", @commit.title)) |
72 | end | 72 | end |
73 | 73 | ||
74 | def note_issue_email(recipient_id, note_id) | 74 | 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.delay.note_commit_email(note.noteable.author_email, note.id) | 14 | + Notify.delay.note_commit_email(note.commit_author.id, note.id) |
15 | else | 15 | else |
16 | # Otherwise ignore it | 16 | # Otherwise ignore it |
17 | nil | 17 | nil |