summaryrefslogtreecommitdiff
path: root/app/mailers
diff options
context:
space:
mode:
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