From 6c15c18fa455502bf0b80316390eefde40d42a8a Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 9 Jan 2020 18:07:52 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/mailers/emails/projects.rb | 2 +- app/mailers/notify.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'app/mailers') 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 -- cgit v1.2.3