Skip to main content

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

  1. Create/edit notification templates with title and body
  2. Use variables like {{user_name}}, {{app_name}} for personalization
  3. Preview template with sample data
  4. Save as draft or publish for use

Send Notifications

  1. Choose template or create new notification
  2. Select target audience:
    • All users (broadcast)
    • Specific user list (targeted)
  3. Send immediately or schedule for later
  4. Track delivery status and engagement

Announcements (Settings Page)

  1. Create announcement in settings
  2. Set visibility period and priority
  3. Announcement appears in mobile app settings
  4. Users can dismiss or mark as read

Bell Notifications (Home Page)

  1. Create notification for bell icon
  2. Set priority and display duration
  3. Notification appears in mobile app home page
  4. Users can tap to view details or dismiss

History & Retrigger

  1. View all sent notifications in history
  2. Filter by date, template, or status
  3. Retrigger previous notifications to specific users
  4. 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

ActionOperation
Create TemplateupsertNotificationTemplate(input)
List TemplatesnotificationTemplates(filter)
Send NotificationsendNotification(input)
SchedulescheduleNotification(input)
View HistorynotificationHistory(filter)
RetriggerretriggerNotification(input)
Create AnnouncementcreateAnnouncement(input)
Create Bell NotifcreateBellNotification(input)