Commit 47d269c1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'rs-letter_opener_web' into 'master'

Add letter_opener_web gem

Sent emails in the development environment will no longer automatically
be opened in the browser. If a sent email needs to be viewed, it can be
found at the `/rails/letter_opener` route.

See merge request !3893
parents c01ff1f5 702380f1
...@@ -242,7 +242,7 @@ group :development do ...@@ -242,7 +242,7 @@ group :development do
gem 'brakeman', '~> 3.2.0', require: false gem 'brakeman', '~> 3.2.0', require: false
gem "annotate", "~> 2.7.0" gem "annotate", "~> 2.7.0"
gem "letter_opener", '~> 1.1.2' gem 'letter_opener_web', '~> 1.3.0'
gem 'quiet_assets', '~> 1.0.2' gem 'quiet_assets', '~> 1.0.2'
gem 'rerun', '~> 0.11.0' gem 'rerun', '~> 0.11.0'
gem 'bullet', require: false gem 'bullet', require: false
......
...@@ -448,8 +448,12 @@ GEM ...@@ -448,8 +448,12 @@ GEM
kgio (2.10.0) kgio (2.10.0)
launchy (2.4.3) launchy (2.4.3)
addressable (~> 2.3) addressable (~> 2.3)
letter_opener (1.1.2) letter_opener (1.4.1)
launchy (~> 2.2) launchy (~> 2.2)
letter_opener_web (1.3.0)
actionmailer (>= 3.2)
letter_opener (~> 1.0)
railties (>= 3.2)
licensee (8.0.0) licensee (8.0.0)
rugged (>= 0.24b) rugged (>= 0.24b)
listen (3.0.5) listen (3.0.5)
...@@ -954,7 +958,7 @@ DEPENDENCIES ...@@ -954,7 +958,7 @@ DEPENDENCIES
jquery-turbolinks (~> 2.1.0) jquery-turbolinks (~> 2.1.0)
jquery-ui-rails (~> 5.0.0) jquery-ui-rails (~> 5.0.0)
kaminari (~> 0.16.3) kaminari (~> 0.16.3)
letter_opener (~> 1.1.2) letter_opener_web (~> 1.3.0)
licensee (~> 8.0.0) licensee (~> 8.0.0)
loofah (~> 2.0.3) loofah (~> 2.0.3)
mail_room (~> 0.6.1) mail_room (~> 0.6.1)
......
...@@ -36,7 +36,7 @@ Rails.application.configure do ...@@ -36,7 +36,7 @@ Rails.application.configure do
# For having correct urls in mails # For having correct urls in mails
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
# Open sent mails in browser # Open sent mails in browser
config.action_mailer.delivery_method = :letter_opener config.action_mailer.delivery_method = :letter_opener_web
# Don't make a mess when bootstrapping a development environment # Don't make a mess when bootstrapping a development environment
config.action_mailer.perform_deliveries = (ENV['BOOTSTRAP'] != '1') config.action_mailer.perform_deliveries = (ENV['BOOTSTRAP'] != '1')
......
...@@ -16,16 +16,18 @@ Rails.application.routes.draw do ...@@ -16,16 +16,18 @@ Rails.application.routes.draw do
end end
end end
if Rails.env.development?
# Make the built-in Rails routes available in development, otherwise they'd # Make the built-in Rails routes available in development, otherwise they'd
# get swallowed by the `namespace/project` route matcher below. # get swallowed by the `namespace/project` route matcher below.
# #
# See https://git.io/va79N # See https://git.io/va79N
if Rails.env.development?
get '/rails/mailers' => 'rails/mailers#index' get '/rails/mailers' => 'rails/mailers#index'
get '/rails/mailers/:path' => 'rails/mailers#preview' get '/rails/mailers/:path' => 'rails/mailers#preview'
get '/rails/info/properties' => 'rails/info#properties' get '/rails/info/properties' => 'rails/info#properties'
get '/rails/info/routes' => 'rails/info#routes' get '/rails/info/routes' => 'rails/info#routes'
get '/rails/info' => 'rails/info#index' get '/rails/info' => 'rails/info#index'
mount LetterOpenerWeb::Engine, at: '/rails/letter_opener'
end end
namespace :ci do namespace :ci do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment