forked from heartcombo/devise
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request heartcombo#1282 from apocalyptiq/master
Allow to set default 'from' header of Devise mails in custom mailer class
- Loading branch information
Showing
7 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +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 DeviseMailer. | ||
# 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 = "[email protected]" | ||
|
||
# Configure the class responsible to send e-mails. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ class ConfirmationInstructionsTest < ActionMailer::TestCase | |
|
||
def setup | ||
setup_mailer | ||
Devise.mailer = 'Devise::Mailer' | ||
Devise.mailer_sender = '[email protected]' | ||
end | ||
|
||
|
@@ -35,6 +36,11 @@ def mail | |
assert_equal ['[email protected]'], mail.from | ||
end | ||
|
||
test 'setup sender from custom mailer defaults' do | ||
Devise.mailer = 'Users::Mailer' | ||
assert_equal ['[email protected]'], mail.from | ||
end | ||
|
||
test 'setup reply to as copy from sender' do | ||
assert_equal ['[email protected]'], mail.reply_to | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ class ResetPasswordInstructionsTest < ActionMailer::TestCase | |
|
||
def setup | ||
setup_mailer | ||
Devise.mailer = 'Devise::Mailer' | ||
Devise.mailer_sender = '[email protected]' | ||
end | ||
|
||
|
@@ -38,6 +39,11 @@ def mail | |
assert_equal ['[email protected]'], mail.from | ||
end | ||
|
||
test 'setup sender from custom mailer defaults' do | ||
Devise.mailer = 'Users::Mailer' | ||
assert_equal ['[email protected]'], mail.from | ||
end | ||
|
||
test 'setup reply to as copy from sender' do | ||
assert_equal ['[email protected]'], mail.reply_to | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ class UnlockInstructionsTest < ActionMailer::TestCase | |
|
||
def setup | ||
setup_mailer | ||
Devise.mailer = 'Devise::Mailer' | ||
Devise.mailer_sender = '[email protected]' | ||
end | ||
|
||
|
@@ -38,6 +39,11 @@ def mail | |
assert_equal ['[email protected]'], mail.from | ||
end | ||
|
||
test 'setup sender from custom mailer defaults' do | ||
Devise.mailer = 'Users::Mailer' | ||
assert_equal ['[email protected]'], mail.from | ||
end | ||
|
||
test 'setup reply to as copy from sender' do | ||
assert_equal ['[email protected]'], mail.reply_to | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Users::Mailer < Devise::Mailer | ||
default :from => '[email protected]' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +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 DeviseMailer. | ||
# 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 = "[email protected]" | ||
|
||
# Configure the class responsible to send e-mails. | ||
|