Changeset 0.28.6 (#192)
This commit is contained in:
@@ -91,6 +91,42 @@ POST /admin/notifications/test-email → send test email to requesting ad
|
||||
Requires admin role. Loads SMTP config from platform settings,
|
||||
sends a test message to the admin's registered email address.
|
||||
|
||||
### Admin Broadcast (v0.28.6)
|
||||
|
||||
```
|
||||
POST /admin/notifications/broadcast
|
||||
```
|
||||
|
||||
**Auth:** Admin only.
|
||||
|
||||
Sends a `system.announcement` notification to all active users via
|
||||
`NotifyMany`. Also emits a `system.broadcast` WebSocket event for
|
||||
real-time visibility.
|
||||
|
||||
**Request body:**
|
||||
|
||||
```json
|
||||
{
|
||||
"title": "Scheduled Maintenance",
|
||||
"message": "Servers will be down from 2-4 AM EST.",
|
||||
"level": "warning"
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| `title` | string | yes | Short summary shown in bell dropdown |
|
||||
| `message` | string | yes | Detail text |
|
||||
| `level` | string | no | `info` (default), `warning`, or `critical` |
|
||||
|
||||
**Response:**
|
||||
|
||||
```json
|
||||
{ "message": "broadcast sent", "count": 42 }
|
||||
```
|
||||
|
||||
`count` is the number of active users notified.
|
||||
|
||||
### WebSocket Events
|
||||
|
||||
| Event | Payload | Description |
|
||||
@@ -98,6 +134,7 @@ sends a test message to the admin's registered email address.
|
||||
| `notification.new` | Full notification object | New notification created |
|
||||
| `notification.read` | `{"id": "uuid"}` | Single notification marked read |
|
||||
| `notification.read` | `{"action": "mark_all_read"}` | All notifications marked read |
|
||||
| `system.broadcast` | `{"title", "message", "level"}` | Admin announcement (v0.28.6) |
|
||||
|
||||
These are targeted via `Hub.SendToUser` — no room subscription
|
||||
required. Used for badge sync across tabs.
|
||||
@@ -106,7 +143,8 @@ required. Used for badge sync across tabs.
|
||||
|
||||
See [enums.md](enums.md#notification-types) for the canonical list.
|
||||
Types are free-form strings (`domain.action` convention) — new types
|
||||
don't require migration.
|
||||
don't require migration. Core types include `system.announcement`
|
||||
(admin broadcast, v0.28.6).
|
||||
|
||||
### Retention
|
||||
|
||||
|
||||
Reference in New Issue
Block a user