From 10dcdeca4baa065a9efdf229bbcf0d4e4e7e0e9d Mon Sep 17 00:00:00 2001 From: Jonathan Fritz Date: Mon, 14 Aug 2017 15:30:09 -0400 Subject: [PATCH] PLT-7375: Send batched emails if batching is enabled and user has not explicitly set their email interval preference --- app/notification.go | 4 ++-- config/config.json | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/notification.go b/app/notification.go index b9153037e97..2b8c0c8c4f2 100644 --- a/app/notification.go +++ b/app/notification.go @@ -333,8 +333,8 @@ func sendNotificationEmail(post *model.Post, user *model.User, channel *model.Ch if *utils.Cfg.EmailSettings.EnableEmailBatching { var sendBatched bool if result := <-Srv.Store.Preference().Get(user.Id, model.PREFERENCE_CATEGORY_NOTIFICATIONS, model.PREFERENCE_NAME_EMAIL_INTERVAL); result.Err != nil { - // if the call fails, assume it hasn't been set and don't batch notifications for this user - sendBatched = false + // if the call fails, assume that the interval has not been explicitly set and batch the notifications + sendBatched = true } else { // if the user has chosen to receive notifications immediately, don't batch them sendBatched = result.Data.(model.Preference).Value != model.PREFERENCE_EMAIL_INTERVAL_NO_BATCHING_SECONDS diff --git a/config/config.json b/config/config.json index 23d1d2ec04f..77d865c5efb 100644 --- a/config/config.json +++ b/config/config.json @@ -77,13 +77,13 @@ }, "SqlSettings": { "DriverName": "mysql", - "DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s", + "DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s", "DataSourceReplicas": [], "DataSourceSearchReplicas": [], "MaxIdleConns": 20, "MaxOpenConns": 300, "Trace": false, - "AtRestEncryptKey": "", + "AtRestEncryptKey": "mp7na5x1miithou7kzxxffw75757n8i6", "QueryTimeout": 30 }, "LogSettings": { @@ -111,7 +111,7 @@ "DriverName": "local", "Directory": "./data/", "EnablePublicLink": false, - "PublicLinkSalt": "", + "PublicLinkSalt": "kresho3jxyunrtphn8ioh1cspq7x9xdo", "InitialFont": "luximbi.ttf", "AmazonS3AccessKeyId": "", "AmazonS3SecretAccessKey": "", @@ -119,7 +119,8 @@ "AmazonS3Region": "us-east-1", "AmazonS3Endpoint": "s3.amazonaws.com", "AmazonS3SSL": true, - "AmazonS3SignV2": false + "AmazonS3SignV2": false, + "AmazonS3SSE": false }, "EmailSettings": { "EnableSignUpWithEmail": true, @@ -136,11 +137,11 @@ "SMTPServer": "dockerhost", "SMTPPort": "2500", "ConnectionSecurity": "", - "InviteSalt": "", + "InviteSalt": "qey337qy64yhbshqy8p9ed9wk6ohs39t", "SendPushNotifications": false, "PushNotificationServer": "", "PushNotificationContents": "generic", - "EnableEmailBatching": false, + "EnableEmailBatching": true, "EmailBatchingBufferSize": 256, "EmailBatchingInterval": 30, "SkipServerCertificateVerification": false, @@ -307,4 +308,4 @@ "PluginSettings": { "Plugins": {} } -} +} \ No newline at end of file