Ste*_*oss 2 ruby ruby-on-rails
到目前为止,我一直很高兴使用异常通知,并且在开发模式下运行时从未发送过电子邮件.现在,宝石似乎想在发生异常时向我发送电子邮件 - 特别是路由错误.是否有一些配置设置我不见了?dox似乎已经干涸并且被吹走了.
假设您有一个初始化程序来设置您的配置,只需将其包装在条件中以检查它是否处于生产模式:
if Rails.env.production?
Whatever::Application.config.middleware.use ExceptionNotifier,
:email_prefix => "[Whatever] ",
:sender_address => %{"notifier" <notifier@example.com>},
:exception_recipients => %w{exceptions@example.com}
end
Run Code Online (Sandbox Code Playgroud)