Skip to content

Commit d98a199

Browse files
committed
work on removing greetings from templates
1 parent 995e940 commit d98a199

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\nYour workspace **{{.Labels.name}}** was deleted.\nThe specified reason was "**{{.Labels.reason}}{{ if .Labels.initiator }} ({{ .Labels.initiator }}){{end}}**".' WHERE id = 'f517da0b-cdc9-410f-ab89-a86107c420ed';
2+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\nAutomatic build of your workspace **{{.Labels.name}}** failed.\nThe specified reason was "**{{.Labels.reason}}**".' WHERE id = '381df2a9-c0c0-4749-420f-80a9280c66f9';
3+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\nYour workspace **{{.Labels.name}}** has been updated automatically to the latest template version ({{.Labels.template_version_name}}).' WHERE id = 'c34a0c09-0704-4cac-bd1c-0c0146811c2b';
4+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\nNew user account **{{.Labels.created_account_name}}** has been created.' WHERE id = '4e19c0ac-94e1-4532-9515-d1801aa283b2';
5+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\nUser account **{{.Labels.deleted_account_name}}** has been deleted.' WHERE id = 'f44d9314-ad03-4bc8-95d0-5cad491da6b6';
6+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\nUser account **{{.Labels.suspended_account_name}}** has been suspended.' WHERE id = 'b02ddd82-4733-4d02-a2d7-c36f3598997d';
7+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\nYour account **{{.Labels.suspended_account_name}}** has been suspended.' WHERE id = '6a2f0609-9b69-4d36-a989-9f5925b6cbff';
8+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\nUser account **{{.Labels.activated_account_name}}** has been activated.' WHERE id = '9f5af851-8408-4e73-a7a1-c6502ba46689';
9+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\nYour account **{{.Labels.activated_account_name}}** has been activated.' WHERE id = '1a6a6bea-ee0a-43e2-9e7c-eabdb53730e4';
10+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\n\nA manual build of the workspace **{{.Labels.name}}** using the template **{{.Labels.template_name}}** failed (version: **{{.Labels.template_version_name}}**).\nThe workspace build was initiated by **{{.Labels.initiator}}**.' WHERE id = '2faeee0f-26cb-4e96-821c-85ccb9f71513';
11+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},
12+
13+
Template **{{.Labels.template_display_name}}** has failed to build {{.Data.failed_builds}}/{{.Data.total_builds}} times over the last {{.Data.report_frequency}}.
14+
15+
**Report:**
16+
{{range $version := .Data.template_versions}}
17+
**{{$version.template_version_name}}** failed {{$version.failed_count}} time{{if gt $version.failed_count 1}}s{{end}}:
18+
{{range $build := $version.failed_builds}}
19+
* [{{$build.workspace_owner_username}} / {{$build.workspace_name}} / #{{$build.build_number}}]({{base_url}}/@{{$build.workspace_owner_username}}/{{$build.workspace_name}}/builds/{{$build.build_number}})
20+
{{- end}}
21+
{{end}}
22+
We recommend reviewing these issues to ensure future builds are successful.' WHERE id = '34a20db2-e9cc-4a93-b0e4-8569699d7a00';
23+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\n\nA request to reset the password for your Coder account has been made. Your one-time passcode is:\n\n**{{.Labels.one_time_passcode}}**\n\nIf you did not request to reset your password, you can ignore this message.' WHERE id = '62f86a30-2330-4b61-a26d-311ff3b608cf';
24+
UPDATE notification_templates SET body_template = E'Hello {{.UserName}},\n\n'||
25+
E'The template **{{.Labels.template}}** has been deprecated with the following message:\n\n' ||
26+
E'**{{.Labels.message}}**\n\n' ||
27+
E'New workspaces may not be created from this template. Existing workspaces will continue to function normally.' WHERE id = 'f40fae84-55a2-42cd-99fa-b41c1ca64894';
28+
UPDATE notification_templates SET body_template = E'Hello {{.UserName}},\n\n'||
29+
E'The workspace **{{.Labels.workspace}}** has been created from the template **{{.Labels.template}}** using version **{{.Labels.version}}**.' WHERE id = '281fdf73-c6d6-4cbb-8ff5-888baf8a2fff';
30+
UPDATE notification_templates SET body_template = E'Hello {{.UserName}},\n\n'||
31+
E'A new workspace build has been manually created for your workspace **{{.Labels.workspace}}** by **{{.Labels.initiator}}** to update it to version **{{.Labels.version}}** of template **{{.Labels.template}}**.' WHERE id = 'd089fe7b-d5c5-4c0c-aaf5-689859f7d392';
32+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\n\n'||
33+
E'Your workspace **{{.Labels.workspace}}** has reached the memory usage threshold set at **{{.Labels.threshold}}**.' WHERE id = 'a9d027b4-ac49-4fb1-9f6d-45af15f64e7a';
34+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\n\n'||
35+
E'{{ if eq (len .Data.volumes) 1 }}{{ $volume := index .Data.volumes 0 }}'||
36+
E'Volume **`{{$volume.path}}`** is over {{$volume.threshold}} full in workspace **{{.Labels.workspace}}**.'||
37+
E'{{ else }}'||
38+
E'The following volumes are nearly full in workspace **{{.Labels.workspace}}**\n\n'||
39+
E'{{ range $volume := .Data.volumes }}'||
40+
E'- **`{{$volume.path}}`** is over {{$volume.threshold}} full\n'||
41+
E'{{ end }}'||
42+
E'{{ end }}' WHERE id = 'f047f6a3-5713-40f7-85aa-0394cce9fa3a';
43+
UPDATE notification_templates SET body_template = E'Hi {{.UserName}},\n\n'||
44+
E'This is a test notification.' WHERE id = 'c425f63e-716a-4bf4-ae24-78348f706c3f';
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
UPDATE notification_templates SET body_template = E'Your workspace **{{.Labels.name}}** was deleted.\nThe specified reason was "**{{.Labels.reason}}{{ if .Labels.initiator }} ({{ .Labels.initiator }}){{end}}**".' WHERE id = 'f517da0b-cdc9-410f-ab89-a86107c420ed';
2+
UPDATE notification_templates SET body_template = E'Automatic build of your workspace **{{.Labels.name}}** failed.\nThe specified reason was "**{{.Labels.reason}}**".' WHERE id = '381df2a9-c0c0-4749-420f-80a9280c66f9';
3+
UPDATE notification_templates SET body_template = E'Your workspace **{{.Labels.name}}** has been updated automatically to the latest template version ({{.Labels.template_version_name}}).' WHERE id = 'c34a0c09-0704-4cac-bd1c-0c0146811c2b';
4+
UPDATE notification_templates SET body_template = E'New user account **{{.Labels.created_account_name}}** has been created.' WHERE id = '4e19c0ac-94e1-4532-9515-d1801aa283b2';
5+
UPDATE notification_templates SET body_template = E'User account **{{.Labels.deleted_account_name}}** has been deleted.' WHERE id = 'f44d9314-ad03-4bc8-95d0-5cad491da6b6';
6+
UPDATE notification_templates SET body_template = E'User account **{{.Labels.suspended_account_name}}** has been suspended.' WHERE id = 'b02ddd82-4733-4d02-a2d7-c36f3598997d';
7+
UPDATE notification_templates SET body_template = E'Your account **{{.Labels.suspended_account_name}}** has been suspended.' WHERE id = '6a2f0609-9b69-4d36-a989-9f5925b6cbff';
8+
UPDATE notification_templates SET body_template = E'User account **{{.Labels.activated_account_name}}** has been activated.' WHERE id = '9f5af851-8408-4e73-a7a1-c6502ba46689';
9+
UPDATE notification_templates SET body_template = E'Your account **{{.Labels.activated_account_name}}** has been activated.' WHERE id = '1a6a6bea-ee0a-43e2-9e7c-eabdb53730e4';
10+
UPDATE notification_templates SET body_template = E'A manual build of the workspace **{{.Labels.name}}** using the template **{{.Labels.template_name}}** failed (version: **{{.Labels.template_version_name}}**).\nThe workspace build was initiated by **{{.Labels.initiator}}**.' WHERE id = '2faeee0f-26cb-4e96-821c-85ccb9f71513';
11+
UPDATE notification_templates SET body_template = E'Template **{{.Labels.template_display_name}}** has failed to build {{.Data.failed_builds}}/{{.Data.total_builds}} times over the last {{.Data.report_frequency}}.
12+
13+
**Report:**
14+
{{range $version := .Data.template_versions}}
15+
**{{$version.template_version_name}}** failed {{$version.failed_count}} time{{if gt $version.failed_count 1}}s{{end}}:
16+
{{range $build := $version.failed_builds}}
17+
* [{{$build.workspace_owner_username}} / {{$build.workspace_name}} / #{{$build.build_number}}]({{base_url}}/@{{$build.workspace_owner_username}}/{{$build.workspace_name}}/builds/{{$build.build_number}})
18+
{{- end}}
19+
{{end}}
20+
We recommend reviewing these issues to ensure future builds are successful.' WHERE id = '34a20db2-e9cc-4a93-b0e4-8569699d7a00';
21+
UPDATE notification_templates SET body_template = E'A request to reset the password for your Coder account has been made. Your one-time passcode is:\n\n**{{.Labels.one_time_passcode}}**\n\nIf you did not request to reset your password, you can ignore this message.' WHERE id = '62f86a30-2330-4b61-a26d-311ff3b608cf';
22+
UPDATE notification_templates SET body_template = E'The template **{{.Labels.template}}** has been deprecated with the following message:\n\n' ||
23+
E'**{{.Labels.message}}**\n\n' ||
24+
E'New workspaces may not be created from this template. Existing workspaces will continue to function normally.' WHERE id = 'f40fae84-55a2-42cd-99fa-b41c1ca64894';
25+
UPDATE notification_templates SET body_template = E'The workspace **{{.Labels.workspace}}** has been created from the template **{{.Labels.template}}** using version **{{.Labels.version}}**.' WHERE id = '281fdf73-c6d6-4cbb-8ff5-888baf8a2fff';
26+
UPDATE notification_templates SET body_template = E'A new workspace build has been manually created for your workspace **{{.Labels.workspace}}** by **{{.Labels.initiator}}** to update it to version **{{.Labels.version}}** of template **{{.Labels.template}}**.' WHERE id = 'd089fe7b-d5c5-4c0c-aaf5-689859f7d392';
27+
UPDATE notification_templates SET body_template = E'Your workspace **{{.Labels.workspace}}** has reached the memory usage threshold set at **{{.Labels.threshold}}**.' WHERE id = 'a9d027b4-ac49-4fb1-9f6d-45af15f64e7a';
28+
UPDATE notification_templates SET body_template = E'{{ if eq (len .Data.volumes) 1 }}{{ $volume := index .Data.volumes 0 }}'||
29+
E'Volume **`{{$volume.path}}`** is over {{$volume.threshold}} full in workspace **{{.Labels.workspace}}**.'||
30+
E'{{ else }}'||
31+
E'The following volumes are nearly full in workspace **{{.Labels.workspace}}**\n\n'||
32+
E'{{ range $volume := .Data.volumes }}'||
33+
E'- **`{{$volume.path}}`** is over {{$volume.threshold}} full\n'||
34+
E'{{ end }}'||
35+
E'{{ end }}' WHERE id = 'f047f6a3-5713-40f7-85aa-0394cce9fa3a';
36+
UPDATE notification_templates SET body_template = E'This is a test notification.' WHERE id = 'c425f63e-716a-4bf4-ae24-78348f706c3f';

coderd/notifications/dispatch/smtp/html.gotmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
{{ .Labels._subject }}
1515
</h1>
1616
<div style="line-height: 1.5;">
17+
Hi {{ UserUsername }},
1718
{{ .Labels._body }}
1819
</div>
1920
<div style="text-align: center; margin-top: 32px;">

0 commit comments

Comments
 (0)