Notification Management
Notification Management handles creating, scheduling, and sending mobile app notifications. It includes template management, announcement settings, and notification history with retrigger capabilities.
Roles & Permissions
- Admin: full access (create templates, send notifications, manage announcements)
- Content Manager: create templates, send to specific users
- Viewer: read‑only (view history and templates)
Core Features
- Templates: Reusable notification templates with variables
- Announcements: Settings page announcements for all users
- Bell Notifications: Home page notifications via bell icon
- History: Track all sent notifications with retrigger capability
- Targeting: Send to all users or specific user lists
UI Flows
Template Management
- Create/edit notification templates with title and body
- Use variables like
{{user_name}},{{app_name}}for personalization - Preview template with sample data
- Save as draft or publish for use
Send Notifications
- Choose template or create new notification
- Select target audience:
- All users (broadcast)
- Specific user list (targeted)
- Send immediately or schedule for later
- Track delivery status and engagement
Announcements (Settings Page)
- Create announcement in settings
- Set visibility period and priority
- Announcement appears in mobile app settings
- Users can dismiss or mark as read
Bell Notifications (Home Page)
- Create notification for bell icon
- Set priority and display duration
- Notification appears in mobile app home page
- Users can tap to view details or dismiss
History & Retrigger
- View all sent notifications in history
- Filter by date, template, or status
- Retrigger previous notifications to specific users
- Track delivery metrics and user engagement
Data Model
- Notification Template:
id,name,title,body,variables[],type(ANNOUNCEMENT | BELL_NOTIFICATION),status(DRAFT | ACTIVE),created_at,updated_at - Notification:
id,template_id,title,body,type,target_users[],sent_at,status(SENT | DELIVERED | FAILED),delivery_stats - Announcement:
id,title,body,priority,visibility_period,status,created_at - Bell Notification:
id,title,body,priority,display_duration,status,created_at
GraphQL Contracts
import { gql } from '@apollo/client';
// Template Management
export const UPSERT_TEMPLATE = gql`
mutation UpsertNotificationTemplate(
$input: UpsertNotificationTemplateInput!
) {
upsertNotificationTemplate(input: $input) {
success
message
data {
id
name
title
body
type
status
}
}
}
`;
export const LIST_TEMPLATES = gql`
query NotificationTemplates($filter: NotificationTemplateFilter!) {
notificationTemplates(filter: $filter) {
id
name
title
type
status
updated_at
}
}
`;
// Send Notifications
export const SEND_NOTIFICATION = gql`
mutation SendNotification($input: SendNotificationInput!) {
sendNotification(input: $input) {
success
message
data {
id
status
sent_at
}
}
}
`;
export const SCHEDULE_NOTIFICATION = gql`
mutation ScheduleNotification($input: ScheduleNotificationInput!) {
scheduleNotification(input: $input) {
success
message
data {
id
status
scheduled_at
}
}
}
`;
// History & Retrigger
export const LIST_NOTIFICATIONS = gql`
query NotificationHistory($filter: NotificationHistoryFilter!) {
notificationHistory(filter: $filter) {
id
title
type
target_count
sent_at
status
delivery_stats
}
}
`;
export const RETRIGGER_NOTIFICATION = gql`
mutation RetriggerNotification($input: RetriggerNotificationInput!) {
retriggerNotification(input: $input) {
success
message
data {
id
status
}
}
}
`;
// Announcements
export const CREATE_ANNOUNCEMENT = gql`
mutation CreateAnnouncement($input: CreateAnnouncementInput!) {
createAnnouncement(input: $input) {
success
message
data {
id
title
priority
status
}
}
}
`;
// Bell Notifications
export const CREATE_BELL_NOTIFICATION = gql`
mutation CreateBellNotification($input: CreateBellNotificationInput!) {
createBellNotification(input: $input) {
success
message
data {
id
title
priority
status
}
}
}
`;
Validation & Rules
- Template name: required, unique, 3-50 characters
- Title/body: required, max 200/1000 characters respectively
- Variables: must be valid format
{{variable_name}} - Target users: must be valid user IDs or "all"
- Scheduled time: must be in future
- Announcements: priority must be LOW/MEDIUM/HIGH
- Bell notifications: display duration 1-30 days
Troubleshooting
- "Template not found": verify template exists and is ACTIVE status
- "Notification not delivered": check user's notification permissions and app status
- "Retrigger failed": ensure original notification exists and target users are valid
- "Announcement not visible": verify visibility period and user's app version
- "Bell notification disappeared": check display duration and priority settings
Mapping Table
| Action | Operation |
|---|---|
| Create Template | upsertNotificationTemplate(input) |
| List Templates | notificationTemplates(filter) |
| Send Notification | sendNotification(input) |
| Schedule | scheduleNotification(input) |
| View History | notificationHistory(filter) |
| Retrigger | retriggerNotification(input) |
| Create Announcement | createAnnouncement(input) |
| Create Bell Notif | createBellNotification(input) |