Files
coder/coderd/database/migrations/000264_manual_build_failed_notification_template.up.sql
Sas Swart fac77f956e fix(coderd/notifications): simplify TemplateWorkspaceManualBuildFailed (#15067)
This PR closes #15065.

As advised by @mtojek, a template's display name may be set to "", which
is not useful in an email notification. We'd like to provide a friendly
name for the template, but it also needs to be identifiable.

As such, we fall back to template.Name in the case that the template's
display name is empty.
2024-10-15 21:02:02 +02:00

17 lines
711 B
SQL

UPDATE notification_templates
SET
body_template = E'Hi {{.UserName}},\n\n' ||
-- Revert to a single label for the template name:
E'A manual build of the workspace **{{.Labels.name}}** using the template **{{.Labels.template_name}}** failed (version: **{{.Labels.template_version_name}}**).\n\n' ||
E'The workspace build was initiated by **{{.Labels.initiator}}**.'
WHERE
id = '2faeee0f-26cb-4e96-821c-85ccb9f71513';
UPDATE notification_templates
SET
body_template = E'Hi {{.UserName}},\n\n' ||
-- Revert to a single label for the template name:
E'The template **{{.Labels.name}}** was deleted by **{{ .Labels.initiator }}**.\n\n'
WHERE
id = '29a09665-2a4c-403f-9648-54301670e7be';