summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console/email_settings.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-08-16 14:41:47 -0400
committerChristopher Speller <crspeller@gmail.com>2016-08-16 14:41:47 -0400
commit8203fd16ce3356d69b0cc51287d0a1fc25318b2d (patch)
treea25893649505d0a75fc1d0aac16790b3e07981c4 /webapp/components/admin_console/email_settings.jsx
parentdde158c57f24e6da6ad5d05eebc104fccec855e8 (diff)
downloadchat-8203fd16ce3356d69b0cc51287d0a1fc25318b2d.tar.gz
chat-8203fd16ce3356d69b0cc51287d0a1fc25318b2d.tar.bz2
chat-8203fd16ce3356d69b0cc51287d0a1fc25318b2d.zip
PLT-3647 Email Batching (#3718)
* PLT-3647 Added config settings for email batching * PLT-3647 Refactored generation of email notification * PLT-3647 Added serverside code for email batching * PLT-3647 Updated settings UI to enable email batching * PLT-3647 Removed debug code * PLT-3647 Fixed 0-padding of minutes in batched notification * PLT-3647 Updated clientside UI for when email batching is disabled * Go fmt * PLT-3647 Changed email batching to be disabled by default * Updated batched email message * Added email batching toggle to system console * Changed Email Notifications > Immediate setting to a 30 second batch interval * Go fmt * Fixed link to Mattermost icon in batched email notification * Updated users to use 30 second email batching by default * Fully disabled email batching when clustering is enabled * Fixed email batching setting in the system console * Fixed casing of 'Send Email notifications' -> 'Send email notifications' * Updating UI Improvements for email batching (#3736) * Updated text for notification settings and SiteURL. * Prevented enabling email batching when SiteURL isn't set in the system console * Re-added a couple debug messages * Added warning text when clustering is enabled
Diffstat (limited to 'webapp/components/admin_console/email_settings.jsx')
-rw-r--r--webapp/components/admin_console/email_settings.jsx50
1 files changed, 50 insertions, 0 deletions
diff --git a/webapp/components/admin_console/email_settings.jsx b/webapp/components/admin_console/email_settings.jsx
index 01f38dc21..b05a3f905 100644
--- a/webapp/components/admin_console/email_settings.jsx
+++ b/webapp/components/admin_console/email_settings.jsx
@@ -32,6 +32,7 @@ export default class EmailSettings extends AdminSettings {
config.EmailSettings.SMTPServer = this.state.smtpServer;
config.EmailSettings.SMTPPort = this.state.smtpPort;
config.EmailSettings.ConnectionSecurity = this.state.connectionSecurity;
+ config.EmailSettings.EnableEmailBatching = this.state.enableEmailBatching;
config.ServiceSettings.EnableSecurityFixAlert = this.state.enableSecurityFixAlert;
return config;
@@ -48,6 +49,7 @@ export default class EmailSettings extends AdminSettings {
smtpServer: config.EmailSettings.SMTPServer,
smtpPort: config.EmailSettings.SMTPPort,
connectionSecurity: config.EmailSettings.ConnectionSecurity,
+ enableEmailBatching: config.EmailSettings.EnableEmailBatching,
enableSecurityFixAlert: config.ServiceSettings.EnableSecurityFixAlert
};
}
@@ -64,6 +66,34 @@ export default class EmailSettings extends AdminSettings {
}
renderSettings() {
+ let enableEmailBatchingDisabledText = null;
+
+ if (this.props.config.ClusterSettings.Enable) {
+ enableEmailBatchingDisabledText = (
+ <span
+ key='admin.email.enableEmailBatching.clusterEnabled'
+ className='help-text'
+ >
+ <FormattedHTMLMessage
+ id='admin.email.enableEmailBatching.clusterEnabled'
+ defaultMessage='Email batching cannot be enabled unless the SiteURL is configured in <b>Configuration > SiteURL</b>.'
+ />
+ </span>
+ );
+ } else if (!this.props.config.ServiceSettings.SiteURL) {
+ enableEmailBatchingDisabledText = (
+ <span
+ key='admin.email.enableEmailBatching.siteURL'
+ className='help-text'
+ >
+ <FormattedHTMLMessage
+ id='admin.email.enableEmailBatching.siteURL'
+ defaultMessage='Email batching cannot be enabled unless the SiteURL is configured in <b>Configuration > SiteURL</b>.'
+ />
+ </span>
+ );
+ }
+
return (
<SettingsGroup>
<BooleanSetting
@@ -83,6 +113,26 @@ export default class EmailSettings extends AdminSettings {
value={this.state.sendEmailNotifications}
onChange={this.handleChange}
/>
+ <BooleanSetting
+ id='enableEmailBatching'
+ label={
+ <FormattedMessage
+ id='admin.email.enableEmailBatchingTitle'
+ defaultMessage='Enable Email Batching: '
+ />
+ }
+ helpText={[
+ <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>.'
+ />,
+ enableEmailBatchingDisabledText
+ ]}
+ value={this.state.enableEmailBatching && !this.props.config.ClusterSettings.Enable && this.props.config.ServiceSettings.SiteURL}
+ onChange={this.handleChange}
+ disabled={!this.state.sendEmailNotifications || this.props.config.ClusterSettings.Enable || !this.props.config.ServiceSettings.SiteURL}
+ />
<TextSetting
id='feedbackName'
label={