Notification Architecture
How notifications flow through the Gauzy system.
Notification Channelsโ
Channel Matrixโ
| Event | In-App | Push | WebSocket | |
|---|---|---|---|---|
| Task assigned | โ | โ | โ | โ |
| Timesheet submitted | โ | โ | โ | โ |
| Timesheet approved | โ | โ | โ | โ |
| Invoice sent | โ | โ | โ | โ |
| @mention | โ | โ | โ | โ |
| Team update | โ | โ | โ | โ |
| Timer started | โ | โ | โ | โ |
Service Implementationโ
@Injectable()
export class NotificationService {
async notify(recipientId: string, type: NotificationType, data: any) {
// 1. Check user preferences
const prefs = await this.getPreferences(recipientId);
// 2. Create in-app notification
if (prefs.inApp) {
await this.createInAppNotification(recipientId, type, data);
}
// 3. Send email
if (prefs.email) {
await this.emailQueue.add("notify", { recipientId, type, data });
}
// 4. Push via WebSocket
if (prefs.push) {
this.wsGateway.sendToUser(recipientId, "notification", { type, data });
}
}
}
User Preferencesโ
Users configure notification preferences per channel:
{
"assignTask": { "inApp": true, "email": true, "push": true },
"mention": { "inApp": true, "email": true, "push": true },
"approval": { "inApp": true, "email": true, "push": false },
"teams": { "inApp": true, "email": false, "push": false }
}
Related Pagesโ
- Notification System โ feature
- WebSocket Architecture โ WebSocket
- Email Templates โ emails