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
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
dde158c57f
Коммит
8203fd16ce
@@ -47,6 +47,9 @@ const (
|
||||
RESTRICT_EMOJI_CREATION_ADMIN = "admin"
|
||||
RESTRICT_EMOJI_CREATION_SYSTEM_ADMIN = "system_admin"
|
||||
|
||||
EMAIL_BATCHING_BUFFER_SIZE = 256
|
||||
EMAIL_BATCHING_INTERVAL = 30
|
||||
|
||||
SITENAME_MAX_LENGTH = 30
|
||||
)
|
||||
|
||||
@@ -166,6 +169,9 @@ type EmailSettings struct {
|
||||
SendPushNotifications *bool
|
||||
PushNotificationServer *string
|
||||
PushNotificationContents *string
|
||||
EnableEmailBatching *bool
|
||||
EmailBatchingBufferSize *int
|
||||
EmailBatchingInterval *int
|
||||
}
|
||||
|
||||
type RateLimitSettings struct {
|
||||
@@ -508,6 +514,21 @@ func (o *Config) SetDefaults() {
|
||||
*o.EmailSettings.FeedbackOrganization = ""
|
||||
}
|
||||
|
||||
if o.EmailSettings.EnableEmailBatching == nil {
|
||||
o.EmailSettings.EnableEmailBatching = new(bool)
|
||||
*o.EmailSettings.EnableEmailBatching = false
|
||||
}
|
||||
|
||||
if o.EmailSettings.EmailBatchingBufferSize == nil {
|
||||
o.EmailSettings.EmailBatchingBufferSize = new(int)
|
||||
*o.EmailSettings.EmailBatchingBufferSize = EMAIL_BATCHING_BUFFER_SIZE
|
||||
}
|
||||
|
||||
if o.EmailSettings.EmailBatchingInterval == nil {
|
||||
o.EmailSettings.EmailBatchingInterval = new(int)
|
||||
*o.EmailSettings.EmailBatchingInterval = EMAIL_BATCHING_INTERVAL
|
||||
}
|
||||
|
||||
if !IsSafeLink(o.SupportSettings.TermsOfServiceLink) {
|
||||
o.SupportSettings.TermsOfServiceLink = nil
|
||||
}
|
||||
@@ -871,6 +892,14 @@ func (o *Config) IsValid() *AppError {
|
||||
return NewLocAppError("Config.IsValid", "model.config.is_valid.listen_address.app_error", nil, "")
|
||||
}
|
||||
|
||||
if *o.ClusterSettings.Enable && *o.EmailSettings.EnableEmailBatching {
|
||||
return NewLocAppError("Config.IsValid", "model.config.is_valid.cluster_email_batching.app_error", nil, "")
|
||||
}
|
||||
|
||||
if len(*o.ServiceSettings.SiteURL) == 0 && *o.EmailSettings.EnableEmailBatching {
|
||||
return NewLocAppError("Config.IsValid", "model.config.is_valid.site_url_email_batching.app_error", nil, "")
|
||||
}
|
||||
|
||||
if o.TeamSettings.MaxUsersPerTeam <= 0 {
|
||||
return NewLocAppError("Config.IsValid", "model.config.is_valid.max_users.app_error", nil, "")
|
||||
}
|
||||
@@ -947,6 +976,14 @@ func (o *Config) IsValid() *AppError {
|
||||
return NewLocAppError("Config.IsValid", "model.config.is_valid.email_reset_salt.app_error", nil, "")
|
||||
}
|
||||
|
||||
if *o.EmailSettings.EmailBatchingBufferSize <= 0 {
|
||||
return NewLocAppError("Config.IsValid", "model.config.is_valid.email_batching_buffer_size.app_error", nil, "")
|
||||
}
|
||||
|
||||
if *o.EmailSettings.EmailBatchingInterval < 30 {
|
||||
return NewLocAppError("Config.IsValid", "model.config.is_valid.email_batching_interval.app_error", nil, "")
|
||||
}
|
||||
|
||||
if o.RateLimitSettings.MemoryStoreSize <= 0 {
|
||||
return NewLocAppError("Config.IsValid", "model.config.is_valid.rate_mem.app_error", nil, "")
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user