Make Notify#new_issue_email resque friendly.
This commit is contained in:
parent
2d124d9496
commit
39061af9f8
|
@ -13,12 +13,9 @@ class Notify < ActionMailer::Base
|
||||||
mail(:to => @user.email, :subject => "gitlab | Account was created for you")
|
mail(:to => @user.email, :subject => "gitlab | Account was created for you")
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_issue_email(issue)
|
def new_issue_email(issue_id)
|
||||||
@issue = Issue.find(issue['id'])
|
@issue = Issue.find(issue_id)
|
||||||
@user = @issue.assignee
|
mail(:to => @issue.assignee_email, :subject => "gitlab | New Issue was created")
|
||||||
@project = @issue.project
|
|
||||||
|
|
||||||
mail(:to => @user.email, :subject => "gitlab | New Issue was created")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def note_wall_email(recipient_id, note_id)
|
def note_wall_email(recipient_id, note_id)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
||||||
%td{:align => "left", :style => "padding: 20px 0 0;"}
|
%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; "}
|
%h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
||||||
= link_to project_issue_url(@project, @issue), :title => @issue.title do
|
= link_to project_issue_url(@issue.project, @issue), :title => @issue.title do
|
||||||
= "Issue ##{@issue.id.to_s}"
|
= "Issue ##{@issue.id.to_s}"
|
||||||
= truncate(@issue.title, :length => 45)
|
= truncate(@issue.title, :length => 45)
|
||||||
%br
|
%br
|
||||||
|
|
|
@ -59,7 +59,7 @@ describe Notify do
|
||||||
let(:issue) { Factory.create(:issue, :assignee => assignee, :project => project ) }
|
let(:issue) { Factory.create(:issue, :assignee => assignee, :project => project ) }
|
||||||
|
|
||||||
describe 'that are new' do
|
describe 'that are new' do
|
||||||
subject { Notify.new_issue_email(issue) }
|
subject { Notify.new_issue_email(issue.id) }
|
||||||
|
|
||||||
it_behaves_like 'an assignee email'
|
it_behaves_like 'an assignee email'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue