Commit 39061af9f8f19d114b48f79a66c22116a52e57be
1 parent
2d124d94
Exists in
master
and in
4 other branches
Make Notify#new_issue_email resque friendly.
Showing
3 changed files
with
5 additions
and
8 deletions
Show diff stats
app/mailers/notify.rb
... | ... | @@ -13,12 +13,9 @@ class Notify < ActionMailer::Base |
13 | 13 | mail(:to => @user.email, :subject => "gitlab | Account was created for you") |
14 | 14 | end |
15 | 15 | |
16 | - def new_issue_email(issue) | |
17 | - @issue = Issue.find(issue['id']) | |
18 | - @user = @issue.assignee | |
19 | - @project = @issue.project | |
20 | - | |
21 | - mail(:to => @user.email, :subject => "gitlab | New Issue was created") | |
16 | + def new_issue_email(issue_id) | |
17 | + @issue = Issue.find(issue_id) | |
18 | + mail(:to => @issue.assignee_email, :subject => "gitlab | New Issue was created") | |
22 | 19 | end |
23 | 20 | |
24 | 21 | def note_wall_email(recipient_id, note_id) | ... | ... |
app/views/notify/new_issue_email.html.haml
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} |
11 | 11 | %td{:align => "left", :style => "padding: 20px 0 0;"} |
12 | 12 | %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} |
13 | - = link_to project_issue_url(@project, @issue), :title => @issue.title do | |
13 | + = link_to project_issue_url(@issue.project, @issue), :title => @issue.title do | |
14 | 14 | = "Issue ##{@issue.id.to_s}" |
15 | 15 | = truncate(@issue.title, :length => 45) |
16 | 16 | %br | ... | ... |
spec/mailers/notify_spec.rb
... | ... | @@ -59,7 +59,7 @@ describe Notify do |
59 | 59 | let(:issue) { Factory.create(:issue, :assignee => assignee, :project => project ) } |
60 | 60 | |
61 | 61 | describe 'that are new' do |
62 | - subject { Notify.new_issue_email(issue) } | |
62 | + subject { Notify.new_issue_email(issue.id) } | |
63 | 63 | |
64 | 64 | it_behaves_like 'an assignee email' |
65 | 65 | ... | ... |