Skip to content

Commit

Permalink
[GH87] Add "receive reminder" setting to login flow (#117)
Browse files Browse the repository at this point in the history
* Add "receive reminder" to login flow and minor flow refactoring

* Improve texts
  • Loading branch information
larkox authored May 28, 2020
1 parent 8fbe2c8 commit c252ee0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server/mscalendar/welcome_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ func (wf *welcomeFlow) makeSteps() {
FalseButtonMessage: "No - Do not notify me of new events",
TrueResponseMessage: "Great, you will receive a message any time you receive a new event.",
FalseResponseMessage: "Great, you will not receive any notification on new events.",
}, &flow.SimpleStep{
Title: "Receive reminder",
Message: "Do you want to receive a reminder for upcoming events?",
PropertyName: store.ReceiveUpcomingEventReminderName,
TrueButtonMessage: "Yes - I would like to receive reminders for upcoming events",
FalseButtonMessage: "No - Do not notify me of upcoming events",
TrueResponseMessage: "Great, you will receive a message before your meetings.",
FalseResponseMessage: "Great, you will not receive any notification for upcoming events.",
}, &flow.EmptyStep{
Title: "Daily Summary",
Message: "Remember that you can set-up a daily summary by typing `/mscalendar summary time 8:00AM`.",
Expand Down
3 changes: 3 additions & 0 deletions server/store/flow_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const (
GetConfirmationPropertyName = "get_confirmation"
ReceiveNotificationsDuringMeetingName = "receive_notifications_during_meetings"
SubscribePropertyName = "subscribe"
ReceiveUpcomingEventReminderName = "receive_reminder"
)

func (s *pluginStore) SetProperty(userID, propertyName string, value bool) error {
Expand All @@ -20,6 +21,8 @@ func (s *pluginStore) SetProperty(userID, propertyName string, value bool) error
user.Settings.UpdateStatus = value
case GetConfirmationPropertyName:
user.Settings.GetConfirmation = value
case ReceiveUpcomingEventReminderName:
user.Settings.ReceiveReminders = value
case ReceiveNotificationsDuringMeetingName:
user.Settings.ReceiveNotificationsDuringMeeting = value
default:
Expand Down

0 comments on commit c252ee0

Please sign in to comment.