diff options
author | Robb Kidd <robb@thekidds.org> | 2012-05-15 07:42:47 +0400 |
---|---|---|
committer | Robb Kidd <robb@thekidds.org> | 2012-05-16 06:37:33 +0400 |
commit | 5fe75649b3e278562b241abadb7d5a62146cff34 (patch) | |
tree | f9f2c2047854cb349544b47f5167fb02d2786685 /app/mailers | |
parent | dd921053c8ef598bad3c7a16331c296d581f0080 (diff) |
Rename changed_mr_email to reassigned_mr_email & make resque friendly
#changed_merge_request_email was really sending emails about merge
request reassignments. Updated method name to reflect that.
Update method to take ids and then perform #finds itself during mailer
queue worker kick-off.
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/notify.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 875e83e5331..5e8af49738b 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -58,13 +58,12 @@ class Notify < ActionMailer::Base @project = @merge_request.project mail(:to => @user.email, :subject => "gitlab | new merge request | #{@merge_request.title} ") end - - def changed_merge_request_email(user, merge_request) - @user = user - @merge_request = MergeRequest.find(merge_request.id) - @assignee_was ||= User.find(@merge_request.assignee_id_was) - @project = @merge_request.project - mail(:to => @user['email'], :subject => "gitlab | merge request changed | #{@merge_request.title} ") + + def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id) + recipient = User.find(recipient_id) + @merge_request = MergeRequest.find(merge_request_id) + @previous_assignee ||= User.find(previous_assignee_id) + mail(:to => recipient.email, :subject => "gitlab | merge request changed | #{@merge_request.title} ") end def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id) |