summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJonathan <jonfritz@gmail.com>2017-07-31 11:51:43 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2017-07-31 11:51:43 -0400
commitd01261a228fd6cda693623a85832bd567693512e (patch)
tree473326274476f3ae54382e59403fd8b5e9c832f1 /webapp
parent8d7dcf44e2c6951a501c74dca21d453f2f9966e4 (diff)
downloadchat-d01261a228fd6cda693623a85832bd567693512e.tar.gz
chat-d01261a228fd6cda693623a85832bd567693512e.tar.bz2
chat-d01261a228fd6cda693623a85832bd567693512e.zip
PLT-7177: Change the default email frequency to 15 minutes if batching is enabled on the server. (#7036)
* PLT-7177: Found default preference that needs to be changed * PLT-7177: Front end behaves as desired * PLT-7177: Changed default batching interval on server side * PLT-7177: Added unit tests for new default interval * PLT-7177: Removed unused import * PLT-7177: Renamed constants to increase clarity
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/admin_console/email_settings.jsx6
-rw-r--r--webapp/components/user_settings/email_notification_setting.jsx15
-rwxr-xr-xwebapp/i18n/en.json2
3 files changed, 14 insertions, 9 deletions
diff --git a/webapp/components/admin_console/email_settings.jsx b/webapp/components/admin_console/email_settings.jsx
index d7694ebb6..e48bc46ab 100644
--- a/webapp/components/admin_console/email_settings.jsx
+++ b/webapp/components/admin_console/email_settings.jsx
@@ -21,9 +21,7 @@ export default class EmailSettings extends AdminSettings {
super(props);
this.getConfigFromState = this.getConfigFromState.bind(this);
-
this.handleSaved = this.handleSaved.bind(this);
-
this.renderSettings = this.renderSettings.bind(this);
}
@@ -138,11 +136,11 @@ export default class EmailSettings extends AdminSettings {
<FormattedHTMLMessage
key='admin.email.enableEmailBatchingDesc'
id='admin.email.enableEmailBatchingDesc'
- defaultMessage='When true, users can have email notifications for multiple direct messages and mentions combined into a single email, configurable in <b>Account Settings > Notifications</b>.'
+ defaultMessage='When true, users will have email notifications for multiple direct messages and mentions combined into a single email. Batching will occur at a default interval of 15 minutes, configurable in Account Settings > Notifications.'
/>,
enableEmailBatchingDisabledText
]}
- value={this.state.enableEmailBatching && !this.props.config.ClusterSettings.Enable && this.props.config.ServiceSettings.SiteURL}
+ value={this.state.enableEmailBatching && !this.props.config.ClusterSettings.Enable && Boolean(this.props.config.ServiceSettings.SiteURL)}
onChange={this.handleChange}
disabled={!this.state.sendEmailNotifications || this.props.config.ClusterSettings.Enable || !this.props.config.ServiceSettings.SiteURL}
/>
diff --git a/webapp/components/user_settings/email_notification_setting.jsx b/webapp/components/user_settings/email_notification_setting.jsx
index 4dd15f0be..5abdc3384 100644
--- a/webapp/components/user_settings/email_notification_setting.jsx
+++ b/webapp/components/user_settings/email_notification_setting.jsx
@@ -28,13 +28,20 @@ export default class EmailNotificationSetting extends React.Component {
super(props);
this.submit = this.submit.bind(this);
-
this.expand = this.expand.bind(this);
this.collapse = this.collapse.bind(this);
- this.state = {
- emailInterval: PreferenceStore.getInt(Preferences.CATEGORY_NOTIFICATIONS, Preferences.EMAIL_INTERVAL, Preferences.INTERVAL_IMMEDIATE)
- };
+ if (global.mm_config.EnableEmailBatching === 'true') {
+ // when email batching is enabled, the default interval is 15 minutes
+ this.state = {
+ emailInterval: PreferenceStore.getInt(Preferences.CATEGORY_NOTIFICATIONS, Preferences.EMAIL_INTERVAL, Preferences.INTERVAL_FIFTEEN_MINUTES)
+ };
+ } else {
+ // otherwise, the default interval is immediately
+ this.state = {
+ emailInterval: PreferenceStore.getInt(Preferences.CATEGORY_NOTIFICATIONS, Preferences.EMAIL_INTERVAL, Preferences.INTERVAL_IMMEDIATE)
+ };
+ }
}
handleChange(enableEmail, emailInterval) {
diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json
index deec452d2..e138660b0 100755
--- a/webapp/i18n/en.json
+++ b/webapp/i18n/en.json
@@ -267,7 +267,7 @@
"admin.email.emailSuccess": "No errors were reported while sending an email. Please check your inbox to make sure.",
"admin.email.enableEmailBatching.clusterEnabled": "Email batching cannot be enabled when High Availability mode is enabled.",
"admin.email.enableEmailBatching.siteURL": "Email batching cannot be enabled unless the SiteURL is configured in <b>Configuration > SiteURL</b>.",
- "admin.email.enableEmailBatchingDesc": "When true, users can have email notifications for multiple direct messages and mentions combined into a single email, configurable in <b>Account Settings > Notifications</b>.",
+ "admin.email.enableEmailBatchingDesc": "When true, users will have email notifications for multiple direct messages and mentions combined into a single email. Batching will occur at a default interval of 15 minutes, configurable in Account Settings > Notifications.",
"admin.email.enableEmailBatchingTitle": "Enable Email Batching:",
"admin.email.fullPushNotification": "Send full message snippet",
"admin.email.genericPushNotification": "Send generic description with user and channel names",