Skip to content

Notifications

Pub/Sub

Notifications in the app is based on the classic "pub/sub" pattern.

In the app we have a lot of topics. Each topic can be interpreted as a tube or channel. It contains events/messages. Any user can then choose to add a subscription to any topic in the system. A subscription in this definition can be compared to subscribing to a newsletter. Each time a new edition of a newsletter (in this case the newsletter is a topic, and a new edition is an event), all subscribers are notified and receives the new edition of the newsletter. Users of course only receives the messages from the topic that they have access to based on their role in the app.

Note

For simplicity, a topic can only contain the same type of event/message. This means that any topic, e.g. the "health-changed" topic, can only contain health-changed events/messages.

A subscription has a list of channels which determines the channels that new events will be published to. Each new event at a topic that a user subscribes to will be published to each of the channels configured.

Channels

Notifications can be received through several channels. One or more channels can be selected. The following channels are currently available:

  • Email
  • SMS
  • Push (Web + Mobile)

Warning

For using the SMS channel, a user must have added a phone number to its profile, otherwise the channel will be ignored even if enabled.

Do Not Disturb Periods

The notification service has "Do Not Disturb" feature. This allows users to define periods where notifications should be blocked.

A do not disturb period works in a similar fashion as on your mobile phone. You can add a series of periods where newly triggered notifications should be blocked.

Info

If a notification is triggered inside a do not disturb period, it will not be sent immediately, but instead be queued and sent at the next possible time after the do not disturb period ends.