简体   繁体   中英

Exception notifier plugin not sending emails

Trying to get Rails exception notifier plugin working. I've installed it in my app...

script/plugin install git://github.com/rails/exception_notification.git

Put this at the end of environment.rb outside of the Rails::Initializer call...

ExceptionNotifier.exception_recipients = %w(user@host.com)
ExceptionNotifier.sender_address = %("Error" <abc@xyz.com>)
ExceptionNotifier.email_prefix = "[Error] "

Added these to development.rb ...

config.action_controller.consider_all_requests_local = true
ActionMailer::Base.raise_delivery_errors = true

Added to application_controller.rb

include ExceptionNotifiable
local_addresses.clear

And added this to one of my actions for testing...

raise RuntimeError, "Generating an error"

When I hit the action the exception is raised but no email goes out. Looked in the development log. No sign of email activity.

I verified that I can send a test email in development, so email sending is configured correctly.

ExceptionNotifier doesn't send error email because it considers your request as local. Try to change this config setting:

config.action_controller.consider_all_requests_local = false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM