summaryrefslogtreecommitdiffstats
path: root/model/config.go
diff options
context:
space:
mode:
authorJonathan <jonfritz@gmail.com>2017-08-05 19:52:35 -0400
committerSaturnino Abril <saturnino.abril@gmail.com>2017-08-06 07:52:35 +0800
commit178ccd16cba26144eac404f413440867b360033c (patch)
tree5a2304ee8fbe7586d4101b7e38cd85756e114a05 /model/config.go
parent9f3713aa98011596a62315fd3b96fa2e77044081 (diff)
downloadchat-178ccd16cba26144eac404f413440867b360033c.tar.gz
chat-178ccd16cba26144eac404f413440867b360033c.tar.bz2
chat-178ccd16cba26144eac404f413440867b360033c.zip
System Console: Email notification content setting (#7122)
* PLT-7195: Added new config option, new license feature, and config UI to system console. Still need to implement behaviour change in email batching code * PLT-7195: Modified batch emails to respect email notification content type setting * PLT-7195: Tweaking the colours a bit * PLT-7195: Added support for email notification content type setting in immediate (non-batched) notification messages. Attempted to clean up the code somewhat. Unit tests coming in a future commit * PLT-7195: Added unit tests for non-batched emails * Checked license when applying email content settings * Changed return type of getFormattedPostTime
Diffstat (limited to 'model/config.go')
-rw-r--r--model/config.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go
index 5b0916cd3..55fe8490b 100644
--- a/model/config.go
+++ b/model/config.go
@@ -66,6 +66,9 @@ const (
EMAIL_BATCHING_BUFFER_SIZE = 256
EMAIL_BATCHING_INTERVAL = 30
+ EMAIL_NOTIFICATION_CONTENTS_FULL = "full"
+ EMAIL_NOTIFICATION_CONTENTS_GENERIC = "generic"
+
SITENAME_MAX_LENGTH = 30
SERVICE_SETTINGS_DEFAULT_SITE_URL = ""
@@ -284,6 +287,7 @@ type EmailSettings struct {
EmailBatchingBufferSize *int
EmailBatchingInterval *int
SkipServerCertificateVerification *bool
+ EmailNotificationContentsType *string
}
type RateLimitSettings struct {
@@ -819,6 +823,11 @@ func (o *Config) SetDefaults() {
*o.EmailSettings.SkipServerCertificateVerification = false
}
+ if o.EmailSettings.EmailNotificationContentsType == nil {
+ o.EmailSettings.EmailNotificationContentsType = new(string)
+ *o.EmailSettings.EmailNotificationContentsType = EMAIL_NOTIFICATION_CONTENTS_FULL
+ }
+
if !IsSafeLink(o.SupportSettings.TermsOfServiceLink) {
*o.SupportSettings.TermsOfServiceLink = SUPPORT_SETTINGS_DEFAULT_TERMS_OF_SERVICE_LINK
}
@@ -1550,6 +1559,10 @@ func (o *Config) IsValid() *AppError {
return NewLocAppError("Config.IsValid", "model.config.is_valid.email_batching_interval.app_error", nil, "")
}
+ if !(*o.EmailSettings.EmailNotificationContentsType == EMAIL_NOTIFICATION_CONTENTS_FULL || *o.EmailSettings.EmailNotificationContentsType == EMAIL_NOTIFICATION_CONTENTS_GENERIC) {
+ return NewLocAppError("Config.IsValid", "model.config.is_valid.email_notification_contents_type.app_error", nil, "")
+ }
+
if o.RateLimitSettings.MemoryStoreSize <= 0 {
return NewLocAppError("Config.IsValid", "model.config.is_valid.rate_mem.app_error", nil, "")
}