mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: notify on task auto pause, manual pause and manual resume (#22050)
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
-- Remove Task 'paused' transition template notification
|
||||
DELETE FROM notification_templates WHERE id = '2a74f3d3-ab09-4123-a4a5-ca238f4f65a1';
|
||||
-- Remove Task 'resumed' transition template notification
|
||||
DELETE FROM notification_templates WHERE id = '843ee9c3-a8fb-4846-afa9-977bec578649';
|
||||
@@ -0,0 +1,63 @@
|
||||
-- Task transition to 'paused' status
|
||||
INSERT INTO notification_templates (
|
||||
id,
|
||||
name,
|
||||
title_template,
|
||||
body_template,
|
||||
actions,
|
||||
"group",
|
||||
method,
|
||||
kind,
|
||||
enabled_by_default
|
||||
) VALUES (
|
||||
'2a74f3d3-ab09-4123-a4a5-ca238f4f65a1',
|
||||
'Task Paused',
|
||||
E'Task ''{{.Labels.task}}'' is paused',
|
||||
E'The task ''{{.Labels.task}}'' was paused ({{.Labels.pause_reason}}).',
|
||||
'[
|
||||
{
|
||||
"label": "View task",
|
||||
"url": "{{base_url}}/tasks/{{.UserUsername}}/{{.Labels.task_id}}"
|
||||
},
|
||||
{
|
||||
"label": "View workspace",
|
||||
"url": "{{base_url}}/@{{.UserUsername}}/{{.Labels.workspace}}"
|
||||
}
|
||||
]'::jsonb,
|
||||
'Task Events',
|
||||
NULL,
|
||||
'system'::notification_template_kind,
|
||||
true
|
||||
);
|
||||
|
||||
-- Task transition to 'resumed' status
|
||||
INSERT INTO notification_templates (
|
||||
id,
|
||||
name,
|
||||
title_template,
|
||||
body_template,
|
||||
actions,
|
||||
"group",
|
||||
method,
|
||||
kind,
|
||||
enabled_by_default
|
||||
) VALUES (
|
||||
'843ee9c3-a8fb-4846-afa9-977bec578649',
|
||||
'Task Resumed',
|
||||
E'Task ''{{.Labels.task}}'' has resumed',
|
||||
E'The task ''{{.Labels.task}}'' has resumed.',
|
||||
'[
|
||||
{
|
||||
"label": "View task",
|
||||
"url": "{{base_url}}/tasks/{{.UserUsername}}/{{.Labels.task_id}}"
|
||||
},
|
||||
{
|
||||
"label": "View workspace",
|
||||
"url": "{{base_url}}/@{{.UserUsername}}/{{.Labels.workspace}}"
|
||||
}
|
||||
]'::jsonb,
|
||||
'Task Events',
|
||||
NULL,
|
||||
'system'::notification_template_kind,
|
||||
true
|
||||
);
|
||||
Reference in New Issue
Block a user