summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG2
-rw-r--r--app/mailers/notify.rb2
-rw-r--r--config/gitlab.yml.example1
-rw-r--r--config/initializers/1_settings.rb1
-rw-r--r--spec/mailers/notify_spec.rb3
5 files changed, 7 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b1152a40383..47ff8ce0a5f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -47,6 +47,8 @@ v 7.9.0 (unreleased)
- Fix highliht of selected lines in file
- Reject access to group/project avatar if the user doesn't have access.
- Add database migration to clean group duplicates with same path and name (Make sure you have a backup before update)
+ - Starred projects page at dashboard
+ - Make email display name configurable
v 7.8.2
- Fix service migration issue when upgrading from versions prior to 7.3
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index 65925b61e94..ee27879cf40 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -53,7 +53,7 @@ class Notify < ActionMailer::Base
# The default email address to send emails from
def default_sender_address
address = Mail::Address.new(Gitlab.config.gitlab.email_from)
- address.display_name = "GitLab"
+ address.display_name = Gitlab.config.gitlab.email_display_name
address
end
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 6dff07cf9df..75d9e65aefe 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -43,6 +43,7 @@ production: &base
# email_enabled: true
# Email address used in the "From" field in mails sent by GitLab
email_from: example@example.com
+ email_display_name: GitLab
# Email server smtp settings are in config/initializers/smtp_settings.rb.sample
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 6a8bbb80b9c..70af7a829c4 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -102,6 +102,7 @@ Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http"
Settings.gitlab['email_enabled'] ||= true if Settings.gitlab['email_enabled'].nil?
Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
+Settings.gitlab['email_display_name'] ||= "GitLab"
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git'
Settings.gitlab['user_home'] ||= begin
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 4090fa46205..b3c507ccbe2 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -5,6 +5,7 @@ describe Notify do
include EmailSpec::Matchers
include RepoHelpers
+ let(:gitlab_sender_display_name) { Gitlab.config.gitlab.email_display_name }
let(:gitlab_sender) { Gitlab.config.gitlab.email_from }
let(:recipient) { create(:user, email: 'recipient@example.com') }
let(:project) { create(:project) }
@@ -23,7 +24,7 @@ describe Notify do
shared_examples 'an email sent from GitLab' do
it 'is sent from GitLab' do
sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq('GitLab')
+ expect(sender.display_name).to eq(gitlab_sender_display_name)
expect(sender.address).to eq(gitlab_sender)
end
end