feat: support custom notifications (#19751)

## Description

Adds support for sending an ad‑hoc custom notification to the
authenticated user via API and CLI. This is useful for surfacing the
result of scripts or long‑running tasks. Notifications are delivered
through the configured method and the dashboard Inbox, respecting
existing preferences and delivery settings.

## Changes

* New notification template: “Custom Notification” with a label for a
custom title and a custom message.
* New API endpoint: `POST /api/v2/notifications/custom` to send a custom
notification to the requesting user.
* New API endpoint: `GET /notifications/templates/custom` to get custom
notification template.
* New CLI subcommand: `coder notifications custom <title> <message>` to
send a custom notification to the requesting user.
* Documentation updates: Add a “Custom notifications” section under
Administration > Monitoring > Notifications, including instructions on
sending custom notifications and examples of when to use them.

Closes: https://github.com/coder/coder/issues/19611
This commit is contained in:
Susana Ferreira
2025-09-11 15:08:57 +02:00
committed by GitHub
parent 4c98decfb7
commit eec6c8c120
26 changed files with 1056 additions and 30 deletions
+8 -2
View File
@@ -12,7 +12,7 @@ USAGE:
from
dispatching messages in case of the target outage (for example: unavailable
SMTP
server or Webhook not responding).:
server or Webhook not responding):
$ coder notifications pause
@@ -22,11 +22,17 @@ USAGE:
- Send a test notification. Administrators can use this to verify the
notification
target settings.:
target settings:
$ coder notifications test
- Send a custom notification to the requesting user. Sending notifications
targeting other users or groups is currently not supported:
$ coder notifications custom "Custom Title" "Custom Message"
SUBCOMMANDS:
custom Send a custom notification
pause Pause notifications
resume Resume notifications
test Send a test notification
+9
View File
@@ -0,0 +1,9 @@
coder v0.0.0-devel
USAGE:
coder notifications custom <title> <message>
Send a custom notification
———
Run `coder --help` for a list of global options.