Enable to configure feedback recipient address (PR #901)

This commit is contained in:
kidhab 2021-12-28 19:40:26 +01:00 committed by GitHub
parent 1f6598c144
commit 4306389f93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -103,7 +103,7 @@ class Mailer < ActionMailer::Base
@user = user
@feedback = feedback
mail to: FoodsoftConfig[:notification][:error_recipients],
mail to: feedback_recipients,
from: user,
subject: I18n.t('mailer.feedback.subject')
end
@ -179,4 +179,9 @@ class Mailer < ActionMailer::Base
address.display_name = name
address.format
end
# use the (new) feedback_recipients option, but fallback to error_recipients for backwards compatibility
def feedback_recipients
FoodsoftConfig[:notification][:feedback_recipients] || FoodsoftConfig[:notification][:error_recipients]
end
end

View file

@ -137,6 +137,8 @@ default: &defaults
notification:
error_recipients:
- admin@foodcoop.test
feedback_recipients:
- support@foodcoop.test
sender_address: "\"Foodsoft Error\" <foodsoft@foodcoop.test>"
email_prefix: "[Foodsoft]"