FIX: restore "every email" default for old accounts in mailing list mode

- Change default for mailing list mode frequency to daily
- Remove bootbox warning for mailing list mode (cause default is daily)
This commit is contained in:
Sam 2016-05-27 12:07:10 +10:00
parent 89b730600a
commit 8c3a0b44ba
5 changed files with 15 additions and 24 deletions

View File

@ -130,21 +130,6 @@ export default Ember.Controller.extend(CanCheckEmails, {
actions: {
checkMailingList(){
Em.run.next(()=>{
const postsPerDay = this.get('model.mailing_list_posts_per_day');
if (!postsPerDay || postsPerDay < 2) {
return true;
}
bootbox.confirm(I18n.t("user.enable_mailing_list", {count: postsPerDay}), I18n.t("no_value"), I18n.t("yes_value"), (success) => {
if (!success) {
this.set('model.user_option.mailing_list_mode', false);
}
});
});
},
save() {
this.set('saved', false);

View File

@ -203,7 +203,7 @@
{{#unless siteSettings.disable_mailing_list_mode}}
<div class='control-group pref-mailing-list-mode'>
<label class="control-label">{{i18n 'user.mailing_list_mode.label'}}</label>
{{preference-checkbox labelKey="user.mailing_list_mode.enabled" warning="checkMailingList" checked=model.user_option.mailing_list_mode}}
{{preference-checkbox labelKey="user.mailing_list_mode.enabled" checked=model.user_option.mailing_list_mode}}
<div class='instructions'>{{{i18n 'user.mailing_list_mode.instructions'}}}</div>
{{#if model.user_option.mailing_list_mode}}
<div class='controls controls-dropdown'>

View File

@ -507,12 +507,12 @@ en:
email_activity_summary: "Activity Summary"
mailing_list_mode:
label: "Mailing list mode"
enabled: "Enable mailing list mode."
enabled: "Enable mailing list mode"
instructions: |
This setting overrides the activity summary.<br />
Muted topics and categories are not included in these emails.
daily: "Send daily updates."
individual: "Send an email for every new post."
daily: "Send daily updates"
individual: "Send an email for every new post"
many_per_day: "Send me an email for every new post (about {{dailyEmailEstimate}} per day)."
few_per_day: "Send me an email for every new post (less than 2 per day)."
watched_categories: "Watched"
@ -676,10 +676,6 @@ en:
other_settings: "Other"
categories_settings: "Categories"
enable_mailing_list:
one: "Are you sure you want to be emailed for every new post?"
other: "Are you sure you want to be emailed for every new post?<br><br>This will result in approximately <b>{{count}} emails</b> per day."
new_topic_duration:
label: "Consider topics new when"
not_viewed: "I haven't viewed them yet"

View File

@ -1139,7 +1139,7 @@ user_preferences:
default_email_mailing_list_mode: false
default_email_mailing_list_mode_frequency:
enum: 'MailingListModeSiteSetting'
default: 1
default: 0
disable_mailing_list_mode:
default: false
client: true

View File

@ -0,0 +1,10 @@
class CorrectMailingListModeFrequency < ActiveRecord::Migration
def up
# historically mailing list mode was for every message
# keep working the same way for all old users
execute 'UPDATE user_options SET mailing_list_mode_frequency = 1 where mailing_list_mode'
end
def down
end
end