Skip to content

Commit cd97285

Browse files
feat: add CTAs
1 parent 22ec59d commit cd97285

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

coderd/database/migrations/000270_template_deprecation_notification.up.sql

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@ INSERT INTO notification_templates
33
VALUES (
44
'f40fae84-55a2-42cd-99fa-b41c1ca64894',
55
'Template Deprecated',
6-
E'Template **{{.Labels.template}}** has been deprecated',
6+
E'Template ''{{.Labels.template}}'' has been deprecated',
77
E'Hello {{.UserName}},\n\n'||
88
E'The template **{{.Labels.template}}** has been deprecated with the following message:\n\n' ||
99
E'**{{.Labels.message}}**\n\n' ||
1010
E'New workspaces may not be created from this template. Existing workspaces will continue to function normally.',
1111
'Template Events',
12-
'[]'::jsonb
12+
'[
13+
{
14+
"label": "See workspaces",
15+
"url": "{{base_url}}/workspaces?filter=owner%3Ame+template%3A{{.Labels.template}}"
16+
},
17+
{
18+
"label": "View template",
19+
"url": "{{base_url}}/templates/{{.Labels.organization}}/{{.Labels.template}}"
20+
}
21+
]'::jsonb
1322
);

coderd/templates.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,9 @@ func (api *API) notifyUsersOfTemplateDeprecation(ctx context.Context, template d
876876
userID,
877877
notifications.TemplateTemplateDeprecated,
878878
map[string]string{
879-
"template": template.Name,
880-
"message": template.Deprecated,
879+
"template": template.Name,
880+
"message": template.Deprecated,
881+
"organization": template.OrganizationName,
881882
},
882883
"notify-users-of-template-deprecation",
883884
)

0 commit comments

Comments
 (0)