As shown in code below, recipient's mails are hard-coded, how can I set them in environment variable
Example::Application.config.middleware.use ExceptionNotification::Rack,
:email => {
email_prefix: "[Error] ",
sender_address: %{"Exception Notifier" <[email protected]>},
exception_recipients: %w{[email protected] [email protected]}
}
I've tried exception_recipients: ENV['mail']
%w{ENV['mail']}
"%w{#{ENV['mail']}}"
, but none works, it gives syntax error
Depends on the format you pass the
mail
variable in`. I'd probably go with semicolon separated list of email addresses.And then in the configuration:
Notice the use of
String
to make sure it won't blow up on you if the key is not set (nil
).