Commit cc2484c3e61764adbb61d78c97148c41cf346cd1

Authored by Dmitriy Zaporozhets
1 parent 5857a7a9

Fix sending commit note email to id instead email

app/mailers/notify.rb
... ... @@ -63,12 +63,12 @@ class Notify < ActionMailer::Base
63 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 67 @note = Note.find(note_id)
68 68 @commit = @note.noteable
69 69 @commit = CommitDecorator.decorate(@commit)
70 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 72 end
73 73  
74 74 def note_issue_email(recipient_id, note_id)
... ...
app/observers/note_observer.rb
... ... @@ -11,7 +11,7 @@ class NoteObserver < ActiveRecord::Observer
11 11 notify_team(note)
12 12 elsif note.notify_author
13 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 15 else
16 16 # Otherwise ignore it
17 17 nil
... ...