summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/mailers/devise_mailer.rb8
-rw-r--r--spec/mailers/notify_spec.rb3
2 files changed, 10 insertions, 1 deletions
diff --git a/app/mailers/devise_mailer.rb b/app/mailers/devise_mailer.rb
index 415f6e12885..bd4c1c9226a 100644
--- a/app/mailers/devise_mailer.rb
+++ b/app/mailers/devise_mailer.rb
@@ -3,4 +3,12 @@ class DeviseMailer < Devise::Mailer
default reply_to: Gitlab.config.gitlab.email_reply_to
layout 'devise_mailer'
+
+ protected
+
+ def subject_for(key)
+ subject = super
+ subject << " | #{Gitlab.config.gitlab.email_subject_suffix}" if Gitlab.config.gitlab.email_subject_suffix.length > 0
+ subject
+ end
end
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index cd8578b6f49..0e4130e8a3a 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -831,6 +831,7 @@ describe Notify do
let(:user) { create(:user, email: 'old-email@mail.com') }
before do
+ stub_config_setting(email_subject_suffix: 'A Nice Suffix')
perform_enqueued_jobs do
user.email = "new-email@mail.com"
user.save
@@ -847,7 +848,7 @@ describe Notify do
end
it 'has the correct subject' do
- is_expected.to have_subject "Confirmation instructions"
+ is_expected.to have_subject /^Confirmation instructions/
end
it 'includes a link to the site' do