diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index dc6ef154aac7fd37c5e0631bff79bd27554895f4..328825dfdabce779984a7e307a532f872c15d28d 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -43,14 +43,13 @@ class Notify < ActionMailer::Base mail(:to => recipient.email, :subject => "gitlab | note for merge request | #{@note.project.name} ") end - def note_issue_email(user, note) - @user = user - @note = Note.find(note['id']) - @project = @note.project + def note_issue_email(recipient_id, note_id) + recipient = User.find(recipient_id) + @note = Note.find(note_id) @issue = @note.noteable - mail(:to => @user['email'], :subject => "gitlab | note for issue #{@issue.id} | #{@note.project.name} ") + mail(:to => recipient.email, :subject => "gitlab | note for issue #{@issue.id} | #{@note.project.name} ") end - + def new_merge_request_email(merge_request) @merge_request = MergeRequest.find(merge_request['id']) @user = @merge_request.assignee diff --git a/app/views/notify/note_issue_email.html.haml b/app/views/notify/note_issue_email.html.haml index eb2cbc0c33d1fd6dc9ba94816c63f6e7d547b8aa..17d58bdec737b8dfc1f1788b2e1f9fe38a3324ce 100644 --- a/app/views/notify/note_issue_email.html.haml +++ b/app/views/notify/note_issue_email.html.haml @@ -5,7 +5,7 @@ %td{:align => "left", :style => "padding: 20px 0 0;"} %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} New comment - - = link_to project_issue_url(@project, @issue, :anchor => "note_#{@note.id}") do + = link_to project_issue_url(@issue.project, @issue, :anchor => "note_#{@note.id}") do = "Issue ##{@issue.id.to_s}" = truncate(@issue.title, :length => 35) %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} @@ -13,7 +13,7 @@ %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:style => "padding: 15px 0 15px;", :valign => "top"} %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author.name} + %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} left next message: %br %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 052840967eb3f6e104816a7dcffeeac3b39c3027..e9c87b9b2e98e9eaa90f9ad04f8dbe00862578e0 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -230,7 +230,8 @@ describe Notify do let(:issue) { Factory.create(:issue, :project => project) } let(:note_on_issue_url) { project_issue_url(project, issue, :anchor => "note_#{note.id}") } before(:each) { note.stub(:noteable).and_return(issue) } - subject { Notify.note_issue_email(recipient, note) } + + subject { Notify.note_issue_email(recipient.id, note.id) } it_behaves_like 'a note email'