Notifications

We support multiple channels for notifications:

  • Email
  • Push notifications

Each user can customize notification settings using the /api/v1/notification-settings/ endpoint.

Notification

class lego.apps.notifications.notification.Notification(user, *args, **kwargs)

Bases: object

Lookup notifications settings and use this to notify the user on activated channels.

generate_mail()

Create and sent the email message.

generate_push()

Send a push message to the user.

notify()

Lookup channels per user and notify on the selected channels.

Example Implementation

class lego.apps.notifications.notifications.AnnouncementNotification(user, *args, **kwargs)

Bases: lego.apps.notifications.notification.Notification

Sent a notification to one recipient of an Announcement. The base class verifies the user settings.

generate_mail()

Generate the email message the user should receive.

generate_push()

Generate the push message the user should receive on his/her phone.