summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobb Kidd <robb@thekidds.org>2012-05-15 18:50:36 -0400
committerRobb Kidd <robb@thekidds.org>2012-05-15 22:37:34 -0400
commit435fd8f0874450f2da480fa72b0f014d3f1fe271 (patch)
tree1854169640ea3ed143b53dae3f60739aa22a0c60 /app
parentbb22360d1a7548facff3b72b2f9a0e66c6a55bb7 (diff)
downloadgitlab-ce-435fd8f0874450f2da480fa72b0f014d3f1fe271.tar.gz
Make Notify#note_issue_email resque friendly
Update method to take ids and then perform #finds itself during mailer queue worker kick-off.
Diffstat (limited to 'app')
-rw-r--r--app/mailers/notify.rb11
-rw-r--r--app/views/notify/note_issue_email.html.haml4
2 files changed, 7 insertions, 8 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"}