summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/mailers/notify.rb11
-rw-r--r--app/views/notify/note_issue_email.html.haml4
-rw-r--r--spec/mailers/notify_spec.rb3
3 files changed, 9 insertions, 9 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index dc6ef154aac..328825dfdab 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 eb2cbc0c33d..17d58bdec73 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 052840967eb..e9c87b9b2e9 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'