-
Notifications
You must be signed in to change notification settings - Fork 19
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 #1167 from internetee/remove-hardcoded-default-ema…
…il-sender Remove hardcoded default email sender
- Loading branch information
Showing
5 changed files
with
21 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
class ApplicationMailer < ActionMailer::Base | ||
append_view_path Rails.root.join('app', 'views', 'mailers') | ||
default from: '[email protected]' | ||
layout 'mailer' | ||
|
||
def format(email) | ||
|
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 |
---|---|---|
|
@@ -145,6 +145,7 @@ auction_api_allowed_ips: '' # 192.0.2.0, 192.0.2.1 | |
action_mailer_default_protocol: # default: http | ||
action_mailer_default_host: | ||
action_mailer_default_port: # default: no port (80) | ||
action_mailer_default_from: # [email protected] | ||
|
||
# Since the keys for staging are absent from the repo, we need to supply them separate for testing. | ||
test: | ||
|
@@ -153,6 +154,7 @@ test: | |
release_domains_to_auction: 'false' | ||
auction_api_allowed_ips: '' | ||
action_mailer_default_host: 'registry.test' | ||
action_mailer_default_from: '[email protected]' | ||
|
||
# Airbrake // Errbit: | ||
airbrake_host: "https://your-errbit-host.ee" | ||
|
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 |
---|---|---|
|
@@ -12,4 +12,5 @@ | |
bank_statement_import_dir | ||
time_zone | ||
action_mailer_default_host | ||
action_mailer_default_from | ||
]) |
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,17 @@ | ||
require 'test_helper' | ||
|
||
class ApplicationMailerTest < ActiveSupport::TestCase | ||
def test_reads_default_from_setting_from_config | ||
assert_equal '[email protected]', ENV['action_mailer_default_from'] | ||
|
||
mailer = Class.new(ApplicationMailer) do | ||
def test | ||
# Empty block to avoid template rendering | ||
mail {} | ||
end | ||
end | ||
email = mailer.test | ||
|
||
assert_equal ['[email protected]'], email.from | ||
end | ||
end |