Skip to content

feat: notify users on template deprecation #15195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Oct 24, 2024
Prev Previous commit
Next Next commit
feat: add CTAs
  • Loading branch information
DanielleMaywood committed Oct 23, 2024
commit cd97285cdd0e9eea6f515ba8141ec24058a0b2bc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@ INSERT INTO notification_templates
VALUES (
'f40fae84-55a2-42cd-99fa-b41c1ca64894',
'Template Deprecated',
E'Template **{{.Labels.template}}** has been 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',
'[]'::jsonb
'[
{
"label": "See workspaces",
"url": "{{base_url}}/workspaces?filter=owner%3Ame+template%3A{{.Labels.template}}"
},
{
"label": "View template",
"url": "{{base_url}}/templates/{{.Labels.organization}}/{{.Labels.template}}"
}
]'::jsonb
);
5 changes: 3 additions & 2 deletions coderd/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,9 @@ func (api *API) notifyUsersOfTemplateDeprecation(ctx context.Context, template d
userID,
notifications.TemplateTemplateDeprecated,
map[string]string{
"template": template.Name,
"message": template.Deprecated,
"template": template.Name,
"message": template.Deprecated,
"organization": template.OrganizationName,
},
"notify-users-of-template-deprecation",
)
Expand Down
Loading