Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-05-02 03:12:54 +0300
committerStan Hu <stanhu@gmail.com>2015-05-02 08:57:10 +0300
commit4dda17a5bfe93e06f416fd4e33d487daee41731e (patch)
tree6101ee352ae4f9181813714ce9af2323d6c317ad
parent001c9731e6c03a13699f1cb60e7fbe7f860e30ad (diff)
Make Reply-To config apply to change e-mail confirmation and other notifications
sent through Devise Fix test case that was passing due to a broken `around` statement. Closes #1556
-rw-r--r--CHANGELOG1
-rw-r--r--app/mailers/devise_mailer.rb4
-rw-r--r--config/initializers/devise.rb7
-rw-r--r--spec/mailers/notify_spec.rb3
4 files changed, 7 insertions, 8 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 2364cf5d7fa..218c62e3b9c 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".
- Get Gitorious importer to work again.
- Fix clone URL field and X11 Primary selection (Dmitry Medvinsky)
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