FEATURE: Mailing list mode default disabled (#11091)

Mailing list mode can generate significant email volume, especially on sites with a large user base. Disable mailing list mode via site settings by default so sites don't experience an unexpectedly large cost from outgoing email.
This commit is contained in:
Joshua Rosenfeld 2021-03-04 15:24:37 -05:00 committed by GitHub
parent 8d96713aa0
commit 75dc01627d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 1 deletions

View File

@ -2235,7 +2235,7 @@ user_preferences:
enum: "MailingListModeSiteSetting"
default: 1
disable_mailing_list_mode:
default: false
default: true
client: true
default_email_previous_replies:
enum: "PreviousRepliesSiteSetting"

View File

@ -454,6 +454,7 @@ describe TopicUser do
user1 = Fabricate(:user)
Jobs.run_immediately!
SiteSetting.disable_mailing_list_mode = false
SiteSetting.default_email_mailing_list_mode = true
SiteSetting.default_email_mailing_list_mode_frequency = 1

View File

@ -1682,6 +1682,7 @@ describe User do
SiteSetting.default_email_digest_frequency = 1440 # daily
SiteSetting.default_email_level = UserOption.email_level_types[:never]
SiteSetting.default_email_messages_level = UserOption.email_level_types[:never]
SiteSetting.disable_mailing_list_mode = false
SiteSetting.default_email_mailing_list_mode = true
SiteSetting.default_other_new_topic_duration_minutes = -1 # not viewed

View File

@ -212,6 +212,7 @@ RSpec.describe EmailController do
end
it 'correctly handles mailing list mode' do
SiteSetting.disable_mailing_list_mode = false
user.user_option.update_columns(mailing_list_mode: true)
navigate_to_unsubscribe

View File

@ -91,6 +91,7 @@ describe UserUpdater do
user = Fabricate(:user)
updater = UserUpdater.new(acting_user, user)
date_of_birth = Time.zone.now
SiteSetting.disable_mailing_list_mode = false
theme = Fabricate(:theme, user_selectable: true)
@ -161,6 +162,7 @@ describe UserUpdater do
it "disables email_digests when enabling mailing_list_mode" do
user = Fabricate(:user)
updater = UserUpdater.new(acting_user, user)
SiteSetting.disable_mailing_list_mode = false
val = updater.update(mailing_list_mode: true, email_digests: true)
expect(val).to be_truthy