diff --git a/CHANGELOG.md b/CHANGELOG.md index 311377a7f..2ce9f7e75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Ability to create, manage and reserve spaces - Improved admin's interface to create availabilities - Complete rewrote of the reservation cart functionality with improved stability, performance and sustainability +- Replaced letter_opener by MailCatcher to preview e-mails in development environments - Fix a bug: trainings reservations are not shown in the admin's calendar - Fix a bug: unable to delete an administrator from the system - Fix a bug: unable to delete an event with a linked custom price (#61) diff --git a/Gemfile b/Gemfile index a2394f4fc..0796722e2 100644 --- a/Gemfile +++ b/Gemfile @@ -40,7 +40,7 @@ end group :development do # Preview mail in the browser - gem 'letter_opener' + gem 'mailcatcher' gem 'awesome_print' gem "puma" diff --git a/Gemfile.lock b/Gemfile.lock index 0eab18efc..01219da99 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -128,6 +128,7 @@ GEM tins (>= 1.6.0, < 2) crack (0.4.3) safe_yaml (~> 1.0.0) + daemons (1.2.4) database_cleaner (1.4.1) debug_inspector (0.0.2) descendants_tracker (0.0.4) @@ -166,6 +167,7 @@ GEM multi_json equalizer (0.0.11) erubis (2.7.0) + eventmachine (1.0.9.1) execjs (2.7.0) faker (1.4.3) i18n (~> 0.5) @@ -217,15 +219,19 @@ GEM actionpack (>= 3.0.0) activesupport (>= 3.0.0) kgio (2.9.3) - launchy (2.4.3) - addressable (~> 2.3) - letter_opener (1.3.0) - launchy (~> 2.2) libv8 (3.16.14.11) loofah (2.0.3) nokogiri (>= 1.5.9) mail (2.6.3) mime-types (>= 1.16, < 3) + mailcatcher (0.6.5) + eventmachine (= 1.0.9.1) + mail (~> 2.3) + rack (~> 1.5) + sinatra (~> 1.2) + skinny (~> 0.2.3) + sqlite3 (~> 1.3) + thin (~> 1.5.0) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) message_format (0.0.3) @@ -391,6 +397,9 @@ GEM rack (~> 1.4) rack-protection (~> 1.4) tilt (>= 1.3, < 3) + skinny (0.2.4) + eventmachine (~> 1.0.0) + thin (>= 1.5, < 1.7) spring (1.3.5) sprockets (2.12.4) hike (~> 1.2) @@ -401,6 +410,7 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) + sqlite3 (1.3.13) stripe (1.30.2) json (~> 1.8.1) rest-client (~> 1.4) @@ -411,6 +421,10 @@ GEM therubyracer (0.12.0) libv8 (~> 3.16.14.0) ref + thin (1.5.1) + daemons (>= 1.0.9) + eventmachine (>= 0.12.6) + rack (>= 1.0.0) thor (0.19.1) thread_safe (0.3.5) tilt (1.4.1) @@ -505,7 +519,7 @@ DEPENDENCIES jbuilder_cache_multi jquery-rails kaminari - letter_opener + mailcatcher message_format mini_magick minitest-reporters diff --git a/Procfile b/Procfile index d6f589654..f8a9f7b3c 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,3 @@ web: bundle exec rails server puma -p $PORT -b0.0.0.0 worker: bundle exec sidekiq -C ./config/sidekiq.yml +mail: bundle exec mailcatcher --foreground diff --git a/README.md b/README.md index 2a369a2a3..a8fd03ba9 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,9 @@ In you only intend to run fab-manager on your local machine for testing purposes - user: admin@fab-manager.com - password: adminadmin +13. Email notifications will be caught by MailCatcher. + To see the emails sent by the platform, open your web browser at `http://localhost:1080` to access the MailCatcher interface. + ### Environment Configuration diff --git a/config/environments/development.rb b/config/environments/development.rb index 074739368..d4a92928a 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -39,7 +39,9 @@ Rails.application.configure do # Raises error for missing translations # config.action_view.raise_on_missing_translations = true - config.action_mailer.delivery_method = :letter_opener + config.action_mailer.delivery_method = :smtp + config.action_mailer.smtp_settings = { :address => '127.0.0.1', :port => 1025 } + config.action_mailer.raise_delivery_errors = false config.action_mailer.default_url_options = { :host => 'localhost:5000' } config.log_level = Rails.application.secrets.log_level || :debug