mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Respect the disable_emails=non-staff site setting correctly
This reverts commit c279792130e24dffbbdee8d6cbb0bad46cc13b72. This commit inadvertently removed all of the non-staff email logic, rather than just for the 'test email' button. https://meta.discourse.org/t/112231/5
This commit is contained in:
@ -13,6 +13,8 @@ class Admin::EmailController < Admin::AdminController
|
||||
Jobs::TestEmail.new.execute(to_address: params[:email_address])
|
||||
if SiteSetting.disable_emails == "yes"
|
||||
render json: { sent_test_email_message: I18n.t("admin.email.sent_test_disabled") }
|
||||
elsif SiteSetting.disable_emails == "non-staff" && !User.find_by_email(params[:email_address])&.staff?
|
||||
render json: { sent_test_email_message: I18n.t("admin.email.sent_test_disabled_for_non_staff") }
|
||||
else
|
||||
render json: { sent_test_email_message: I18n.t("admin.email.sent_test") }
|
||||
end
|
||||
|
Reference in New Issue
Block a user