module ExceptionNotifier
class DynamicEmailNotifier < EmailNotifier
def call(exception, options={})
options.reverse_merge!(exception_recipients: Admin.where(notified: true).pluck(:email))
super
end
end
end
and added the following configuration to config/environments/<env>:
It works well when the exceptions are triggered by the HTTP requests, but when the exceptions are from rake tasks, no email is sent, and there is no record in maillog indicating that any email delivery has been tried.
Hi, nikhaldi
I wrote a custom email notifier:
and added the following configuration to
config/environments/<env>
:It works well when the exceptions are triggered by the HTTP requests, but when the exceptions are from rake tasks, no email is sent, and there is no record in maillog indicating that any email delivery has been tried.