From d01261a228fd6cda693623a85832bd567693512e Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 31 Jul 2017 11:51:43 -0400 Subject: 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 --- app/notification.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app/notification.go') diff --git a/app/notification.go b/app/notification.go index d2eb44b3a..d145b21b3 100644 --- a/app/notification.go +++ b/app/notification.go @@ -332,13 +332,12 @@ 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 use the default + // if the call fails, assume it hasn't been set and don't batch notifications for this user sendBatched = false } else { - // default to not using batching if the setting is set to immediate - sendBatched = result.Data.(model.Preference).Value != model.PREFERENCE_DEFAULT_EMAIL_INTERVAL + // 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 } if sendBatched { -- cgit v1.2.3-1-g7c22