summaryrefslogtreecommitdiff
path: root/app/mailers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-09 18:07:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-09 18:07:52 +0000
commit6c15c18fa455502bf0b80316390eefde40d42a8a (patch)
treeb42af022a747fd580a09f36b0e60a9f53ed7b25c /app/mailers
parent263f926c770163788f78af03ab69689c94f57360 (diff)
downloadgitlab-ce-6c15c18fa455502bf0b80316390eefde40d42a8a.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/emails/projects.rb2
-rw-r--r--app/mailers/notify.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb
index 6274879ee99..5c957437039 100644
--- a/app/mailers/emails/projects.rb
+++ b/app/mailers/emails/projects.rb
@@ -51,7 +51,7 @@ module Emails
add_project_headers
headers['X-GitLab-Author'] = @message.author_username
- mail(from: sender(@message.author_id, @message.send_from_committer_email?),
+ mail(from: sender(@message.author_id, send_from_user_email: @message.send_from_committer_email?),
reply_to: @message.reply_to,
subject: @message.subject)
end
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index c7cfefeec9b..92939136de2 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -59,11 +59,11 @@ class Notify < BaseMailer
# Return an email address that displays the name of the sender.
# Only the displayed name changes; the actual email address is always the same.
- def sender(sender_id, send_from_user_email = false)
+ def sender(sender_id, send_from_user_email: false, sender_name: nil)
return unless sender = User.find(sender_id)
address = default_sender_address
- address.display_name = sender.name
+ address.display_name = sender_name.presence || sender.name
if send_from_user_email && can_send_from_user_email?(sender)
address.address = sender.email