summaryrefslogtreecommitdiff
path: root/app/mailers
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-09-14 16:59:28 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-09-24 12:02:26 +0100
commit487ac98a2a7cebb1bdef3a5038c926c56380881c (patch)
treee8123fa91ebe22baedb0d4433ce7b82818f05401 /app/mailers
parent81d949f656979429835e0b6059a10a44faba488b (diff)
downloadgitlab-ce-487ac98a2a7cebb1bdef3a5038c926c56380881c.tar.gz
Ports new refactor from EE to CE
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/emails/merge_requests.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/mailers/emails/merge_requests.rb b/app/mailers/emails/merge_requests.rb
index 67af0a4eb98..be085496731 100644
--- a/app/mailers/emails/merge_requests.rb
+++ b/app/mailers/emails/merge_requests.rb
@@ -3,13 +3,14 @@
module Emails
module MergeRequests
def new_merge_request_email(recipient_id, merge_request_id, reason = nil)
- setup_merge_request_mail(merge_request_id, recipient_id)
+ setup_merge_request_mail(merge_request_id, recipient_id, present: true)
mail_new_thread(@merge_request, merge_request_thread_options(@merge_request.author_id, recipient_id, reason))
end
def new_mention_in_merge_request_email(recipient_id, merge_request_id, updated_by_user_id, reason = nil)
- setup_merge_request_mail(merge_request_id, recipient_id)
+ setup_merge_request_mail(merge_request_id, recipient_id, present: true)
+
mail_answer_thread(@merge_request, merge_request_thread_options(updated_by_user_id, recipient_id, reason))
end
@@ -75,11 +76,16 @@ module Emails
private
- def setup_merge_request_mail(merge_request_id, recipient_id)
+ def setup_merge_request_mail(merge_request_id, recipient_id, present: false)
@merge_request = MergeRequest.find(merge_request_id)
@project = @merge_request.project
@target_url = project_merge_request_url(@project, @merge_request)
+ if present
+ recipient = User.find(recipient_id)
+ @mr_presenter = @merge_request.present(current_user: recipient)
+ end
+
@sent_notification = SentNotification.record(@merge_request, recipient_id, reply_key)
end