diff options
author | Jonathan <jonfritz@gmail.com> | 2017-07-31 11:51:43 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-07-31 11:51:43 -0400 |
commit | d01261a228fd6cda693623a85832bd567693512e (patch) | |
tree | 473326274476f3ae54382e59403fd8b5e9c832f1 /app/notification.go | |
parent | 8d7dcf44e2c6951a501c74dca21d453f2f9966e4 (diff) | |
download | chat-d01261a228fd6cda693623a85832bd567693512e.tar.gz chat-d01261a228fd6cda693623a85832bd567693512e.tar.bz2 chat-d01261a228fd6cda693623a85832bd567693512e.zip |
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
Diffstat (limited to 'app/notification.go')
-rw-r--r-- | app/notification.go | 7 |
1 files changed, 3 insertions, 4 deletions
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 { |