Notifications

Adds a notification table, a notification centre (an Inbox page with tabs for unread and each category, grouped by day, mark read or unread, archive, live updates) and a NotificationBell component with the unread count and the latest notifications for any page header or dashboard, plus a settings page where each person chooses email and text messages. Every new notification lands in the inbox and is emailed (unless the person turned email off); people who opt in to texts get an SMS through your connected Twilio. Staff can send a notification by hand, and any workflow can create one with ctx.db.create("notification", ...).

Notifications: the Inbox page, added to Tablefor, on desktopNotifications: the Inbox page, added to Tablefor, on a phone

What it adds to your app

Tables notification and notification_preference. A notification centre: the Inbox page (tabs, days, read/unread, archive). NotificationBell component for any page. Settings page for email and text messages. A staff page to send a notification by hand. Workflows that email and text each notification as the person prefers.

Tables

  • notification recipient_id, title, body, link, category, priority, read_at, emailed_at, …
  • notification_preference person_id, email, sms, phone

Pages

  • /inbox Inbox (‹recipient_role›)
  • /notification-settings Notification settings (‹recipient_role›)
  • /notifications-admin Notifications (@staff)

Components

  • NotificationInbox A person's notification centre: tabs for unread and each category, grouped by day, mark read or unread, archive, open links, live updates, older pages
  • NotificationSettings Email and text message preferences for the signed-in person
  • NotificationBell A bell for any page header or dashboard: the unread count, the latest notifications, mark read, open the inbox

Rules on every write

  • notification You can mark a notification read, not change it.
  • notification_preference Add a mobile number (with country code) to get text messages.

How its workflows run

Each one is a server workflow in your project: it runs on its trigger, with retries, and its runs show in the builder's log.

  1. Email or text each new notification, as the person prefers

    When a row changes: notification created. Then: Look up notification_preference, then Send email, then Update notification.

  2. Send queued text messages through Twilio

    When a row changes: notification updated, when text_message is queued. Then: Send sms.

Set it up

It merges into the contract of an app you already have. Nothing is overwritten: a name you already use is refused until you pass a prefix.

  1. Pick the project

    Use the button above, or ask your coding agent with the Appbricx MCP server connected (quickstart).

  2. Point it at your tables and roles

    Leave out the ones with defaults; a wrong one is refused with the options your app has.

    ParamWhat it isExample
    recipient_roleThe role whose people get notifications (their own table is the recipient). Optional.member
    email_fieldOptional: the email field on that role's table, for the email copy. Optional.email
    sms_fromOptional: your Twilio phone number (E.164, like +15550100). Leave it out and texts stay off. Optional.+15550100
  3. Connect what it calls

    connect Twilio (builder, Backend, Integrations). Text messages need Twilio connected and sms_from set; email and the inbox work without them.

  4. Preview, then apply to dev

    A dry run shows the diff and the check report; applying it changes your dev environment only.

  5. Deploy

    When dev looks right, deploy. Production gets a snapshot first, so you can roll back.

Use it with your coding agent

The agent reads the template, runs a dry run, shows you the diff and applies it.

Prompt
Add the Notifications template (slug "notifications") to my Appbricx project. Read it with get_template, run use_template with dry_run first and show me the diff, then apply it. Ask me where it attaches if you can't tell from my contract (recipient_role: who receives them; email_field: their email field; sms_from: twilio number).
MCP call
{
  "tool": "use_template",
  "arguments": {
    "slug": "notifications",
    "project_id": "<your project id>",
    "params": {
      "recipient_role": "member",
      "email_field": "email",
      "sms_from": "+15550100"
    },
    "dry_run": true
  }
}
CLI
appbricx templates use notifications --param recipient_role=member --param email_field=email --param sms_from=+15550100 --dry-run

Works with

The services this template calls. Each page lists every action and what connecting it takes.

Your agent adds it. Appbricx runs it.