From 246a0c297e3f123711fe93a3ef0100c5bca9e8d1 Mon Sep 17 00:00:00 2001 From: Allan Guwatudde Date: Thu, 21 Oct 2021 14:00:25 +0300 Subject: [PATCH] [MM-39053] - A/B test for default notification settings (#18655) * [MM-39053] - A/B test for default notification settings * fix tests * first name notifications on * update * Fix bad merge alignment Co-authored-by: Maria A Nunez --- app/users/users.go | 9 +++++++++ model/feature_flags.go | 3 +++ 2 files changed, 12 insertions(+) diff --git a/app/users/users.go b/app/users/users.go index b374d24f96..2c208a62fc 100644 --- a/app/users/users.go +++ b/app/users/users.go @@ -63,6 +63,15 @@ func (us *UserService) createUser(user *model.User) (*model.User, error) { return nil, err } + if us.config().FeatureFlags.NewAccountNoisy { + user.SetDefaultNotifications() + user.NotifyProps[model.DesktopNotifyProp] = model.UserNotifyAll + user.NotifyProps[model.PushNotifyProp] = model.UserNotifyAll + user.NotifyProps[model.ChannelMentionsNotifyProp] = "true" + user.NotifyProps[model.MentionKeysNotifyProp] = user.Username + user.NotifyProps[model.FirstNameNotifyProp] = "true" + } + ruser, err := us.store.Save(user) if err != nil { return nil, err diff --git a/model/feature_flags.go b/model/feature_flags.go index e368c548fe..81b62172ac 100644 --- a/model/feature_flags.go +++ b/model/feature_flags.go @@ -47,6 +47,8 @@ type FeatureFlags struct { // Enable different treatments for first time users, possible values = ("none", "tips_and_next_steps") DownloadAppsCTA string + // Determine whether when a user gets created, they'll have noisy notifications e.g. Send desktop notifications for all activity + NewAccountNoisy bool // Enable Boards Unfurl Preview BoardsUnfurl bool @@ -71,6 +73,7 @@ func (f *FeatureFlags) SetDefaults() { f.AddChannelButton = "by_team_name" f.PrewrittenMessages = "tour_point" f.DownloadAppsCTA = "tips_and_next_steps" + f.NewAccountNoisy = false f.BoardsUnfurl = true f.CallsMobile = false f.AutoTour = "none"