diff options
author | Robert Speicher <robert@gitlab.com> | 2015-05-02 17:48:30 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2015-05-02 17:48:30 +0000 |
commit | 703856c75ee7eefbfb536db306eaeec4c4b35e02 (patch) | |
tree | 1da39f24a91d9e3015efe5cef52b9c7671712a92 | |
parent | cfbff017d0ba1ba4fd896b4762b23853f123c60a (diff) | |
parent | 4dda17a5bfe93e06f416fd4e33d487daee41731e (diff) | |
download | gitlab-ce-703856c75ee7eefbfb536db306eaeec4c4b35e02.tar.gz |
Merge branch 'make-reply-to-work-everywhere' into 'master'
Make Reply-To config apply to change e-mail confirmation and other notifications sent through Devise
Notifications sent through Devise were using the default From: address, and due to a broken test line nothing was actually being run.
The only way to customize the Devise Reply-To field is to use a custom mailer. Moved the e-mail configuration out of the initializers to accommodate this.
Closes #1556
See merge request !596
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/mailers/devise_mailer.rb | 4 | ||||
-rw-r--r-- | config/initializers/devise.rb | 7 | ||||
-rw-r--r-- | spec/mailers/notify_spec.rb | 3 |
4 files changed, 7 insertions, 8 deletions
diff --git a/CHANGELOG b/CHANGELOG index 2c5c9c76ccf..be0c005fa06 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 7.11.0 (unreleased) + - Make Reply-To config apply to change e-mail confirmation and other Devise notifications (Stan Hu) - Don't allow a merge request to be merged when its title starts with "WIP". - Add a page title to every page. - Get Gitorious importer to work again. diff --git a/app/mailers/devise_mailer.rb b/app/mailers/devise_mailer.rb new file mode 100644 index 00000000000..5395fe16414 --- /dev/null +++ b/app/mailers/devise_mailer.rb @@ -0,0 +1,4 @@ +class DeviseMailer < Devise::Mailer + default from: "GitLab <#{Gitlab.config.gitlab.email_from}>" + default reply_to: Gitlab.config.gitlab.email_reply_to +end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 9dce495106f..8f8c4169740 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -2,13 +2,8 @@ # four configuration values can also be set straight in your models. Devise.setup do |config| # ==> Mailer Configuration - # Configure the e-mail address which will be shown in Devise::Mailer, - # note that it will be overwritten if you use your own mailer class with default "from" parameter. - config.mailer_sender = "GitLab <#{Gitlab.config.gitlab.email_from}>" - - # Configure the class responsible to send e-mails. - # config.mailer = "Devise::Mailer" + config.mailer = "DeviseMailer" # ==> ORM configuration # Load and configure the ORM. Supports :active_record (default) and diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index d28b4768545..dbcf7286e45 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -11,9 +11,8 @@ describe Notify do let(:recipient) { create(:user, email: 'recipient@example.com') } let(:project) { create(:project) } - around(:each) { ActionMailer::Base.deliveries.clear } - before(:each) do + ActionMailer::Base.deliveries.clear email = recipient.emails.create(email: "notifications@example.com") recipient.update_attribute(:notification_email, email.email) end |