Rails 4 + Notification Notifier does not send emails in design mode

I am trying to test the Exception Notifier locally (development). Here is my current setup:

development.rb

Myapp::Application.configure do
  # Set Mailer default url
  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.default_url_options = { :host => '0.0.0.0:3000' }
  #config.action_mailer.delivery_method = :file
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
       :address              => 'smtp.gmail.com',
       :port                 => 587,
       :domain               => 'gmail.com',
       :user_name            => 'username@gmail.com',
       :password             => 'password',
       :authentication       => 'plain',
       :enable_starttls_auto => true
   }

  config.middleware.use ExceptionNotification::Rack,
    :email => {
      :email_prefix => "[Myapp Error] ",
      :sender_address => %{"notifier" <no-reply@myapp.com>},
      :exception_recipients => %w{myemail@gmail.com}
    }
end

But when I "create" an error in the application - for example, if I set a non-existent identifier, for example

http://localhost:3000/users/12270/edit

I see only an error in the browser, but the email address is not sent (valid email credentials).

What am I missing?

What are you

+4
source share
3 answers

To disable the error page in development mode, you also need to install:

config.consider_all_requests_local = false
+1
source

ExceptionNotifier 500. , "... ..." 404 . :

( , Rails) "X-Cascade" .

Rails , , (, 404 ); 404, "false".

+1

gem letter_opener .

0

All Articles