Skip to content

Commit

Permalink
Set development delivery_method to :file
Browse files Browse the repository at this point in the history
`:test` sends the emails to the logs, and to see them one has to scroll
back through them. If we configure delivery_method to be `:file`,
mails will also be created in the `./tmp/mails/` directory

One file will be created for each email address sent to that contains
all email content delivered to that address. This allows to easily
review any and all emails sent, without searching through logs.

See:
* #521 (8b45fd42)
* http://blog.mojotech.com/a-decade-of-rails/
  • Loading branch information
tute committed Mar 11, 2016
1 parent 685cba9 commit ae7e66f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/suspenders/app_builder.rb
Expand Up @@ -51,7 +51,7 @@ def raise_on_delivery_errors
def set_test_delivery_method
inject_into_file(
"config/environments/development.rb",
"\n config.action_mailer.delivery_method = :test",
"\n config.action_mailer.delivery_method = :file",
after: "config.action_mailer.raise_delivery_errors = true",
)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/new_project_spec.rb
Expand Up @@ -153,7 +153,7 @@
it "configs :test email delivery method for development" do
dev_env_file = IO.read("#{project_path}/config/environments/development.rb")
expect(dev_env_file).
to match(/^ +config.action_mailer.delivery_method = :test$/)
to match(/^ +config.action_mailer.delivery_method = :file$/)
end

it "uses APPLICATION_HOST, not HOST in the production config" do
Expand Down

0 comments on commit ae7e66f

Please sign in to comment.