feat: notify users on template deprecation (#15195)

Closes https://github.com/coder/coder/issues/15117

Notify users when a template has been deprecated.
This commit is contained in:
Danielle Maywood
2024-10-24 13:12:12 +01:00
committed by GitHub
parent bcd68ee249
commit 095c9797c9
8 changed files with 255 additions and 2 deletions
@@ -0,0 +1 @@
DELETE FROM notification_templates WHERE id = 'f40fae84-55a2-42cd-99fa-b41c1ca64894';
@@ -0,0 +1,22 @@
INSERT INTO notification_templates
(id, name, title_template, body_template, "group", actions)
VALUES (
'f40fae84-55a2-42cd-99fa-b41c1ca64894',
'Template Deprecated',
E'Template ''{{.Labels.template}}'' has been deprecated',
E'Hello {{.UserName}},\n\n'||
E'The template **{{.Labels.template}}** has been deprecated with the following message:\n\n' ||
E'**{{.Labels.message}}**\n\n' ||
E'New workspaces may not be created from this template. Existing workspaces will continue to function normally.',
'Template Events',
'[
{
"label": "See affected workspaces",
"url": "{{base_url}}/workspaces?filter=owner%3Ame+template%3A{{.Labels.template}}"
},
{
"label": "View template",
"url": "{{base_url}}/templates/{{.Labels.organization}}/{{.Labels.template}}"
}
]'::jsonb
);