mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +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:
@ -35,6 +35,10 @@ module Email
|
||||
return skip(SkippedEmailLog.reason_types[:sender_message_blank]) if @message.blank?
|
||||
return skip(SkippedEmailLog.reason_types[:sender_message_to_blank]) if @message.to.blank?
|
||||
|
||||
if SiteSetting.disable_emails == "non-staff"
|
||||
return unless User.find_by_email(to_address)&.staff?
|
||||
end
|
||||
|
||||
return skip(SkippedEmailLog.reason_types[:sender_message_to_invalid]) if to_address.end_with?(".invalid")
|
||||
|
||||
if @message.text_part
|
||||
|
Reference in New Issue
Block a user