Notifications
ClubMS supports in-app notifications and Web Push notifications.
Notification Types
| Type | Trigger |
|---|---|
EVENT_CREATED | New event published |
EVENT_UPDATED | Event details changed |
EVENT_CANCELLED | Event cancelled |
BOOKING_CONFIRMED | Event booking confirmed |
BOOKING_CANCELLED | Booking cancelled |
DONATION_RECEIVED | Donation received |
DONATION_RECURRING_CREATED | Recurring donation started |
DONATION_RECURRING_CANCELLED | Recurring donation stopped |
MEMBERSHIP_RENEWED | Membership renewed |
MEMBERSHIP_EXPIRING | Membership about to expire |
ASSET_BORROW_REQUEST | Loan request submitted |
ASSET_BORROW_APPROVED | Loan approved |
ASSET_BORROW_REJECTED | Loan rejected |
ASSET_RETURN_REQUESTED | Return initiated |
ASSET_RETURN_CONFIRMED | Return confirmed |
SYSTEM | System-wide announcements |
In-App Notifications
- Bell icon in the navbar shows unread count
- Click to view notification list
- Mark individual or all as read
- Links to relevant resource
Push Notifications
Web Push uses the VAPID protocol:
- User opts in via the notification bell
- Browser generates a push subscription
- Subscription is stored in
push_subscriptiontable - Server sends push via Web Push API when events occur
Setup
Generate VAPID keys:
npx web-push generate-vapid-keysSet environment variables:
NEXT_PUBLIC_VAPID_PUBLIC_KEY=BEl6...
VAPID_PRIVATE_KEY=abc...Last updated on