You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(coderd/notifications): improve notification format consistency (#14967)
This Pull request addresses the more trivial items in
#14893.
These were simple formatting changes that I was able to fix despite
limited context.
Some more changes are required for which I will have to dig a bit deeper
into how the template contexts are populated. I'm happy to add those to
this PR or create a subsequent PR.
body_template = E'Hi {{.UserName}},\nUser account **{{.Labels.suspended_account_name}}** has been suspended.'
4
+
WHERE
5
+
id ='b02ddd82-4733-4d02-a2d7-c36f3598997d';
6
+
7
+
UPDATE notification_templates
8
+
SET
9
+
body_template = E'Hi {{.UserName}},\nYour account **{{.Labels.suspended_account_name}}** has been suspended.'
10
+
WHERE
11
+
id ='6a2f0609-9b69-4d36-a989-9f5925b6cbff';
12
+
13
+
UPDATE notification_templates
14
+
SET
15
+
body_template = E'Hi {{.UserName}},\nUser account **{{.Labels.activated_account_name}}** has been activated.'
16
+
WHERE
17
+
id ='9f5af851-8408-4e73-a7a1-c6502ba46689';
18
+
19
+
UPDATE notification_templates
20
+
SET
21
+
body_template = E'Hi {{.UserName}},\nYour account **{{.Labels.activated_account_name}}** has been activated.'
22
+
WHERE
23
+
id ='1a6a6bea-ee0a-43e2-9e7c-eabdb53730e4';
24
+
25
+
UPDATE notification_templates
26
+
SET
27
+
body_template = E'Hi {{.UserName}},\n\New user account **{{.Labels.created_account_name}}** has been created.'
28
+
WHERE
29
+
id ='4e19c0ac-94e1-4532-9515-d1801aa283b2';
30
+
31
+
UPDATE notification_templates
32
+
SET
33
+
body_template = E'Hi {{.UserName}},\n\nUser account **{{.Labels.deleted_account_name}}** has been deleted.'
34
+
WHERE
35
+
id ='f44d9314-ad03-4bc8-95d0-5cad491da6b6';
36
+
37
+
UPDATE notification_templates
38
+
SET
39
+
body_template = E'Hi {{.UserName}}\n\n'||
40
+
E'The template **{{.Labels.name}}** was deleted by **{{ .Labels.initiator }}**.'
41
+
WHERE
42
+
id ='29a09665-2a4c-403f-9648-54301670e7be';
43
+
44
+
UPDATE notification_templates
45
+
SET body_template = E'Hi {{.UserName}}\n'||
46
+
E'Your workspace **{{.Labels.name}}** has been updated automatically to the latest template version ({{.Labels.template_version_name}}).\n'||
47
+
E'Reason for update: **{{.Labels.template_version_message}}**'
48
+
WHERE
49
+
id ='c34a0c09-0704-4cac-bd1c-0c0146811c2b';
50
+
51
+
UPDATE notification_templates
52
+
SET
53
+
body_template = E'Hi {{.UserName}}\n\nYour workspace **{{.Labels.name}}** was deleted.\nThe specified reason was "**{{.Labels.reason}}{{ if .Labels.initiator }} ({{ .Labels.initiator }}){{end}}**".'
54
+
WHERE
55
+
id ='381df2a9-c0c0-4749-420f-80a9280c66f9';
56
+
57
+
UPDATE notification_templates
58
+
SET
59
+
body_template = E'Hi {{.UserName}}\n\nYour workspace **{{.Labels.name}}** was deleted.\nThe specified reason was "**{{.Labels.reason}}{{ if .Labels.initiator }} ({{ .Labels.initiator }}){{end}}**".'
60
+
WHERE
61
+
id ='f517da0b-cdc9-410f-ab89-a86107c420ed';
62
+
63
+
UPDATE notification_templates
64
+
SET
65
+
body_template = E'Hi {{.UserName}}\n\n'||
66
+
E'Your workspace **{{.Labels.name}}** has been marked as [**dormant**](https://coder.com/docs/templates/schedule#dormancy-threshold-enterprise) because of {{.Labels.reason}}.\n'||
67
+
E'Dormant workspaces are [automatically deleted](https://coder.com/docs/templates/schedule#dormancy-auto-deletion-enterprise) after {{.Labels.timeTilDormant}} of inactivity.\n'||
68
+
E'To prevent deletion, use your workspace with the link below.'
69
+
WHERE
70
+
id ='0ea69165-ec14-4314-91f1-69566ac3c5a0';
71
+
72
+
UPDATE notification_templates
73
+
SET
74
+
body_template = E'Hi {{.UserName}}\n\n'||
75
+
E'Your workspace **{{.Labels.name}}** has been marked for **deletion** after {{.Labels.timeTilDormant}} of [dormancy](https://coder.com/docs/templates/schedule#dormancy-auto-deletion-enterprise) because of {{.Labels.reason}}.\n'||
76
+
E'To prevent deletion, use your workspace with the link below.'
77
+
WHERE
78
+
id ='51ce2fdf-c9ca-4be1-8d70-628674f9bc42';
79
+
80
+
UPDATE notification_templates
81
+
SET
82
+
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}}**.'
body_template = E'Hi {{.UserName}},\n\n'||-- Add a \n
7
+
E'User account **{{.Labels.suspended_account_name}}** has been suspended.\n\n'||
8
+
-- Mention the real name of the user who suspended the account:
9
+
E'The newly suspended account belongs to **{{.Labels.suspended_account_user_name}}** and was suspended by **{{.Labels.account_suspender_user_name}}**.'
10
+
WHERE
11
+
id ='b02ddd82-4733-4d02-a2d7-c36f3598997d';
12
+
13
+
-- YourAccountSuspended
14
+
UPDATE notification_templates
15
+
SET
16
+
body_template = E'Hi {{.UserName}},\n\n'||-- Add a \n
17
+
-- Mention who suspended the account:
18
+
E'Your account **{{.Labels.suspended_account_name}}** has been suspended by **{{.Labels.account_suspender_user_name}}**.'
19
+
WHERE
20
+
id ='6a2f0609-9b69-4d36-a989-9f5925b6cbff';
21
+
22
+
-- UserAccountActivated
23
+
UPDATE notification_templates
24
+
SET
25
+
body_template = E'Hi {{.UserName}},\n\n'||-- Add a \n
26
+
E'User account **{{.Labels.activated_account_name}}** has been activated.\n\n'||
27
+
-- Mention the real name of the user who activated the account:
28
+
E'The newly activated account belongs to **{{.Labels.activated_account_user_name}}** and was activated by **{{.Labels.account_activator_user_name}}**.'
29
+
WHERE
30
+
id ='9f5af851-8408-4e73-a7a1-c6502ba46689';
31
+
32
+
-- YourAccountActivated
33
+
UPDATE notification_templates
34
+
SET
35
+
body_template = E'Hi {{.UserName}},\n\n'||-- Add a \n
36
+
-- Mention who activated the account:
37
+
E'Your account **{{.Labels.activated_account_name}}** has been activated by **{{.Labels.account_activator_user_name}}**.'
38
+
WHERE
39
+
id ='1a6a6bea-ee0a-43e2-9e7c-eabdb53730e4';
40
+
41
+
-- UserAccountCreated
42
+
UPDATE notification_templates
43
+
SET
44
+
body_template = E'Hi {{.UserName}},\n\n'||
45
+
E'New user account **{{.Labels.created_account_name}}** has been created.\n\n'||
46
+
-- Mention the real name of the user who created the account:
47
+
E'This new user account was created for **{{.Labels.created_account_user_name}}** by **{{.Labels.account_creator}}**.'
48
+
WHERE
49
+
id ='4e19c0ac-94e1-4532-9515-d1801aa283b2';
50
+
51
+
-- UserAccountDeleted
52
+
UPDATE notification_templates
53
+
SET
54
+
body_template = E'Hi {{.UserName}},\n\n'||
55
+
E'User account **{{.Labels.deleted_account_name}}** has been deleted.\n\n'||
56
+
-- Mention the real name of the user who deleted the account:
57
+
E'The deleted account belonged to **{{.Labels.deleted_account_user_name}}** and was deleted by **{{.Labels.account_deleter_user_name}}**.'
58
+
WHERE
59
+
id ='f44d9314-ad03-4bc8-95d0-5cad491da6b6';
60
+
61
+
-- TemplateDeleted
62
+
UPDATE notification_templates
63
+
SET
64
+
body_template = E'Hi {{.UserName}},\n\n'||-- Add a comma
65
+
E'The template **{{.Labels.name}}** was deleted by **{{ .Labels.initiator }}**.\n\n'||
66
+
-- Mention template display name:
67
+
E'The template''s display name was **{{.Labels.display_name}}**.'
68
+
WHERE
69
+
id ='29a09665-2a4c-403f-9648-54301670e7be';
70
+
71
+
-- WorkspaceAutoUpdated
72
+
UPDATE notification_templates
73
+
SET body_template = E'Hi {{.UserName}},\n\n'||-- Add a comma and a \n
74
+
-- Add a \n:
75
+
E'Your workspace **{{.Labels.name}}** has been updated automatically to the latest template version ({{.Labels.template_version_name}}).\n\n'||
76
+
E'Reason for update: **{{.Labels.template_version_message}}**.'
77
+
WHERE
78
+
id ='c34a0c09-0704-4cac-bd1c-0c0146811c2b';
79
+
80
+
-- WorkspaceAutoBuildFailed
81
+
UPDATE notification_templates
82
+
SET
83
+
body_template = E'Hi {{.UserName}},\n\n'||-- Add a comma
84
+
-- Add a \n after:
85
+
E'Automatic build of your workspace **{{.Labels.name}}** failed.\n\n'||
86
+
E'The specified reason was "**{{.Labels.reason}}**".'
87
+
WHERE
88
+
id ='381df2a9-c0c0-4749-420f-80a9280c66f9';
89
+
90
+
-- WorkspaceDeleted
91
+
UPDATE notification_templates
92
+
SET
93
+
body_template = E'Hi {{.UserName}},\n\n'||-- Add a comma
94
+
-- Add a \n after:
95
+
E'Your workspace **{{.Labels.name}}** was deleted.\n\n'||
96
+
E'The specified reason was "**{{.Labels.reason}}{{ if .Labels.initiator }} ({{ .Labels.initiator }}){{end}}**".'
E'Your workspace **{{.Labels.name}}** has been marked as [**dormant**](https://coder.com/docs/templates/schedule#dormancy-threshold-enterprise) because of {{.Labels.reason}}.\n'||
105
+
E'Dormant workspaces are [automatically deleted](https://coder.com/docs/templates/schedule#dormancy-auto-deletion-enterprise) after {{.Labels.timeTilDormant}} of inactivity.\n'||
106
+
E'To prevent deletion, use your workspace with the link below.'
E'Your workspace **{{.Labels.name}}** has been marked for **deletion** after {{.Labels.timeTilDormant}} of [dormancy](https://coder.com/docs/templates/schedule#dormancy-auto-deletion-enterprise) because of {{.Labels.reason}}.\n'||
115
+
E'To prevent deletion, use your workspace with the link below.'
116
+
WHERE
117
+
id ='51ce2fdf-c9ca-4be1-8d70-628674f9bc42';
118
+
119
+
-- WorkspaceManualBuildFailed
120
+
UPDATE notification_templates
121
+
SET
122
+
body_template = E'Hi {{.UserName}},\n\n'||
123
+
E'A manual build of the workspace **{{.Labels.name}}** using the template **{{.Labels.template_name}}** failed (version: **{{.Labels.template_version_name}}**).\n\n'||
124
+
-- Mention template display name:
125
+
E'The template''s display name was **{{.Labels.template_display_name}}**. '||
126
+
E'The workspace build was initiated by **{{.Labels.initiator}}**.'
0 commit comments