Skip to content

Commit

Permalink
Add ability to set multiple exception recipients
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian-Hirt committed Jan 7, 2024
1 parent 4f99907 commit 5eed862
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ variables set as well:
For the exception notification:

* `ENABLE_EXCEPTION_NOTIFIER`
* `EXCEPTION_NOTIFIER_RECIPIENT`
* `EXCEPTION_NOTIFIER_RECIPIENTS` (optional, only if `ENABLE_EXCEPTION_NOTIFIER` is `true`)
* `EXCEPTION_NOTIFIER_SENDER` (optional)

If you want to add more than one recipient, you can pass in a string where the recipients
are delimited by a semicolon `;`, e.g. `"foo@example.com; bar@example.com`

For the devise mailer

* `DEVISE_MAIL_SENDER` (optional)
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/exception_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
email: {
email_prefix: '[EXCEPTION NOTIFICATION] ',
sender_address: sender,
exception_recipients: Figaro.env.exception_notifier_recipient
exception_recipients: Figaro.env.exception_notifier_recipients.split(';').map(&:strip)
}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ services:
DISCORD_BOT_AUTH: ${DISCORD_BOT_AUTH:?err}
# Exception notification
ENABLE_EXCEPTION_NOTIFIER: ${ENABLE_EXCEPTION_NOTIFIER:-false}
EXCEPTION_NOTIFIER_RECIPIENT: ${EXCEPTION_NOTIFIER_RECIPIENT}
EXCEPTION_NOTIFIER_RECIPIENTS: ${EXCEPTION_NOTIFIER_RECIPIENTS}
EXCEPTION_NOTIFIER_SENDER: ${EXCEPTION_NOTIFIER_SENDER}
# Devise
DEVISE_MAIL_SENDER: ${DEVISE_MAIL_SENDER}
Expand Down

0 comments on commit 5eed862

Please sign in to comment.