-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Hi, nikhaldi
I wrote a custom email notifier:
module ExceptionNotifier
class DynamicEmailNotifier < EmailNotifier
def call(exception, options={})
options.reverse_merge!(exception_recipients: Admin.where(notified: true).pluck(:email))
super
end
end
endand added the following configuration to config/environments/<env>:
Rails.application.configure do
# ...
config.middleware.use ExceptionNotification::Rack,
dynamic_email: {
email_prefix: '[EDM2] ',
sender_address: 'Admin <admin@zzz.zz>',
# Override default action mailer settings.
delivery_method: :smtp,
smtp_settings: {
address: '127.0.0.1',
port: 25,
user_name: 'admin@zzz.zz',
password: Rails.application.secrets[:sender_password],
authentication: :plain,
enable_starttls_auto: true,
openssl_verify_mode: 'none'
}
}
ExceptionNotifier::Rake.configure
endIt 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels