mirror of
https://github.com/coder/coder.git
synced 2026-06-03 21:18:24 +00:00
eec6c8c120
## 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
16 lines
709 B
SQL
16 lines
709 B
SQL
-- Remove Custom Notification template
|
|
DELETE FROM notification_templates WHERE id = '39b1e189-c857-4b0c-877a-511144c18516';
|
|
|
|
-- Recreate the old enum without 'custom'
|
|
CREATE TYPE old_notification_template_kind AS ENUM ('system');
|
|
|
|
-- Update notification_templates to use the old enum
|
|
ALTER TABLE notification_templates
|
|
ALTER COLUMN kind DROP DEFAULT,
|
|
ALTER COLUMN kind TYPE old_notification_template_kind USING (kind::text::old_notification_template_kind),
|
|
ALTER COLUMN kind SET DEFAULT 'system'::old_notification_template_kind;
|
|
|
|
-- Drop the current enum and restore the original name
|
|
DROP TYPE notification_template_kind;
|
|
ALTER TYPE old_notification_template_kind RENAME TO notification_template_kind;
|