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 @user = user
@feedback = feedback @feedback = feedback
mail to: FoodsoftConfig[:notification][:error_recipients], mail to: feedback_recipients,
from: user, from: user,
subject: I18n.t('mailer.feedback.subject') subject: I18n.t('mailer.feedback.subject')
end end
@ -179,4 +179,9 @@ class Mailer < ActionMailer::Base
address.display_name = name address.display_name = name
address.format address.format
end 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 end

View file

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