-
Notifications
You must be signed in to change notification settings - Fork 894
feat(coderd/notifications): improve notification format consistency #14967
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
Changes from 1 commit
70f3486
7e31a34
cf3afd4
4b85f2b
e8ad3ac
2a4d740
e741c43
adffe60
41ed54a
5541331
fe94f0d
98e7501
d8e00c2
d6a339f
920ad31
9e938e5
59e57ac
c907238
2493556
19dccc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,83 @@ | ||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'Hi {{.UserName}},', 'Hi {{.UserName}}')::text | ||
body_template = E'Hi {{.UserName}},\nUser account **{{.Labels.suspended_account_name}}** has been suspended.' | ||
WHERE | ||
id = '29a09665-2a4c-403f-9648-54301670e7be'; | ||
id = 'b02ddd82-4733-4d02-a2d7-c36f3598997d'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\nUser account **{{.Labels.activated_account_name}}** has been activated.' | ||
body_template = E'Hi {{.UserName}},\nYour account **{{.Labels.suspended_account_name}}** has been suspended.' | ||
WHERE | ||
id = '9f5af851-8408-4e73-a7a1-c6502ba46689'; | ||
id = '6a2f0609-9b69-4d36-a989-9f5925b6cbff'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, E'Hi {{.UserName}},\n', 'Hi {{.UserName}},')::text | ||
body_template = E'Hi {{.UserName}},\nUser account **{{.Labels.activated_account_name}}** has been activated.' | ||
WHERE | ||
id = 'b02ddd82-4733-4d02-a2d7-c36f3598997d'; | ||
id = '9f5af851-8408-4e73-a7a1-c6502ba46689'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, E'Hi {{.UserName}},\n', 'Hi {{.UserName}}')::text | ||
body_template = E'Hi {{.UserName}},\nYour account **{{.Labels.activated_account_name}}** has been activated.' | ||
WHERE | ||
id = 'c34a0c09-0704-4cac-bd1c-0c0146811c2b'; | ||
id = '1a6a6bea-ee0a-43e2-9e7c-eabdb53730e4'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, E'({{.Labels.template_version_name}}).\n\n', E'({{.Labels.template_version_name}}).\n')::text | ||
body_template = E'Hi {{.UserName}},\n\New user account **{{.Labels.created_account_name}}** has been created.' | ||
WHERE | ||
id = 'c34a0c09-0704-4cac-bd1c-0c0146811c2b'; | ||
id = '4e19c0ac-94e1-4532-9515-d1801aa283b2'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, E'Hi {{.UserName}},\n', 'Hi {{.UserName}}')::text | ||
body_template = E'Hi {{.UserName}},\n\nUser account **{{.Labels.deleted_account_name}}** has been deleted.' | ||
SasSwart marked this conversation as resolved.
Show resolved
Hide resolved
|
||
WHERE | ||
id = '381df2a9-c0c0-4749-420f-80a9280c66f9'; | ||
id = 'f44d9314-ad03-4bc8-95d0-5cad491da6b6'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, E'\nThe specified reason', 'The specified reason')::text | ||
body_template = E'Hi {{.UserName}}\n\n' || | ||
E'The template **{{.Labels.name}}** was deleted by **{{ .Labels.initiator }}**.' | ||
WHERE | ||
id = '381df2a9-c0c0-4749-420f-80a9280c66f9'; | ||
id = '29a09665-2a4c-403f-9648-54301670e7be'; | ||
|
||
UPDATE notification_templates | ||
SET body_template = E'Hi {{.UserName}}\n' || | ||
E'Your workspace **{{.Labels.name}}** has been updated automatically to the latest template version ({{.Labels.template_version_name}}).\n' || | ||
E'Reason for update: **{{.Labels.template_version_message}}**' | ||
WHERE id = 'c34a0c09-0704-4cac-bd1c-0c0146811c2b'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'Hi {{.UserName}},', 'Hi {{.UserName}}')::text | ||
body_template = E'Hi {{.UserName}}\n\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'; | ||
id = '381df2a9-c0c0-4749-420f-80a9280c66f9'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, E'\nThe specified reason', 'The specified reason')::text | ||
body_template = E'Hi {{.UserName}}\n\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'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'Hi {{.UserName}},', 'Hi {{.UserName}}')::text | ||
body_template = E'Hi {{.UserName}}\n\n' || | ||
E'Your workspace **{{.Labels.name}}** has been marked as [**dormant**](https://coder.com/docs/templates/schedule#dormancy-threshold-enterprise) because of {{.Labels.reason}}.\n' || | ||
E'Dormant workspaces are [automatically deleted](https://coder.com/docs/templates/schedule#dormancy-auto-deletion-enterprise) after {{.Labels.timeTilDormant}} of inactivity.\n' || | ||
E'To prevent deletion, use your workspace with the link below.' | ||
WHERE | ||
id = '0ea69165-ec14-4314-91f1-69566ac3c5a0'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'Hi {{.UserName}},', 'Hi {{.UserName}}')::text | ||
body_template = E'Hi {{.UserName}}\n\n' || | ||
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' || | ||
E'To prevent deletion, use your workspace with the link below.' | ||
WHERE | ||
id = '51ce2fdf-c9ca-4be1-8d70-628674f9bc42'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, E'\nThe workspace build was initiated by', 'The workspace build was initiated by')::text | ||
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'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, E'Hi {{.UserName}},\n', 'Hi {{.UserName}},')::text | ||
WHERE | ||
id = '1a6a6bea-ee0a-43e2-9e7c-eabdb53730e4'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, E'Hi {{.UserName}},\n', 'Hi {{.UserName}},')::text | ||
WHERE | ||
id = '6a2f0609-9b69-4d36-a989-9f5925b6cbff'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,101 @@ | ||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'Hi {{.UserName}}', 'Hi {{.UserName}},')::text | ||
body_template = E'Hi {{.UserName}},\n\n' || | ||
E'User account **{{.Labels.suspended_account_name}}** has been suspended.\n\n' || | ||
E'The newly suspended account belongs to **{{.Labels.suspended_account_user_name}}** and was suspended by **{{.Labels.account_suspender_user_name}}**.' | ||
WHERE | ||
id = '29a09665-2a4c-403f-9648-54301670e7be'; | ||
id = 'b02ddd82-4733-4d02-a2d7-c36f3598997d'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' | ||
'User account **{{.Labels.activated_account_name}}** has been activated. ' | ||
'The newly activated account belongs to **{{.Labels.activated_account_user_name}}** and was activated by **{{.Labels.account_activator_user_name}}**.' | ||
body_template = E'Hi {{.UserName}},\n\n' || | ||
E'Your account **{{.Labels.suspended_account_name}}** has been suspended by **{{.Labels.account_suspender_user_name}}**' | ||
WHERE | ||
id = '9f5af851-8408-4e73-a7a1-c6502ba46689'; | ||
id = '6a2f0609-9b69-4d36-a989-9f5925b6cbff'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'Hi {{.UserName}},', E'Hi {{.UserName}},\n')::text | ||
body_template = E'Hi {{.UserName}},\n\n' || | ||
E'User account **{{.Labels.activated_account_name}}** has been activated.\n\n' || | ||
E'The newly activated account belongs to **{{.Labels.activated_account_user_name}}** and was activated by **{{.Labels.account_activator_user_name}}**.' | ||
WHERE | ||
id = 'b02ddd82-4733-4d02-a2d7-c36f3598997d'; | ||
id = '9f5af851-8408-4e73-a7a1-c6502ba46689'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'Hi {{.UserName}}', E'Hi {{.UserName}},\n')::text | ||
body_template = E'Hi {{.UserName}},\n\n' || | ||
E'Your account **{{.Labels.activated_account_name}}** has been activated by **{{.Labels.account_activator_user_name}}**.' | ||
WHERE | ||
id = 'c34a0c09-0704-4cac-bd1c-0c0146811c2b'; | ||
id = '1a6a6bea-ee0a-43e2-9e7c-eabdb53730e4'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, E'({{.Labels.template_version_name}}).\n', E'({{.Labels.template_version_name}}).\n\n')::text | ||
body_template = E'Hi {{.UserName}},\n\n' || | ||
E'New user account **{{.Labels.created_account_name}}** has been created.\n\n' || | ||
E'This new user account was created for **{{.Labels.created_account_user_name}}** by **{{.Labels.account_creator}}**' | ||
WHERE | ||
id = 'c34a0c09-0704-4cac-bd1c-0c0146811c2b'; | ||
id = '4e19c0ac-94e1-4532-9515-d1801aa283b2'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'Hi {{.UserName}}', E'Hi {{.UserName}},\n')::text | ||
body_template = E'Hi {{.UserName}},\n\n' || | ||
E'User account **{{.Labels.deleted_account_name}}** has been deleted.\n\n' || | ||
E'The deleted account belonged to **{{.Labels.deleted_account_user_name}}** and was deleted by **{{.Labels.account_deleter_user_name}}**.' | ||
WHERE | ||
id = '381df2a9-c0c0-4749-420f-80a9280c66f9'; | ||
id = 'f44d9314-ad03-4bc8-95d0-5cad491da6b6'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'The specified reason', E'\nThe specified reason')::text | ||
body_template = E'Hi {{.UserName}}\n\n' || | ||
E'The template **{{.Labels.name}}** was deleted by **{{ .Labels.initiator }}**.\n\n' || | ||
E'The templates display name was **{{.Labels.display_name}}**.' | ||
WHERE | ||
id = '381df2a9-c0c0-4749-420f-80a9280c66f9'; | ||
id = '29a09665-2a4c-403f-9648-54301670e7be'; | ||
|
||
UPDATE notification_templates | ||
SET body_template = E'Hi {{.UserName}}\n\n' || | ||
E'Your workspace **{{.Labels.name}}** has been updated automatically to the latest template version ({{.Labels.template_version_name}}).\n\n' || | ||
E'Reason for update: **{{.Labels.template_version_message}}**' | ||
WHERE | ||
id = 'c34a0c09-0704-4cac-bd1c-0c0146811c2b'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'Hi {{.UserName}}', 'Hi {{.UserName}},')::text | ||
body_template = E'Hi {{.UserName}}\n\n' || | ||
E'Automatic build of your workspace **{{.Labels.name}}** failed.\n\n' || | ||
E'The specified reason was "**{{.Labels.reason}}**".' | ||
WHERE | ||
id = 'f517da0b-cdc9-410f-ab89-a86107c420ed'; | ||
id = '381df2a9-c0c0-4749-420f-80a9280c66f9'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'The specified reason', E'\nThe specified reason')::text | ||
body_template = E'Hi {{.UserName}},\n\n' || | ||
E'Your workspace **{{.Labels.name}}** was deleted.\n\n' || | ||
E'The specified reason was "**{{.Labels.reason}}{{ if .Labels.initiator }} ({{ .Labels.initiator }}){{end}}**".' | ||
WHERE | ||
id = 'f517da0b-cdc9-410f-ab89-a86107c420ed'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'Hi {{.UserName}}', 'Hi {{.UserName}},')::text | ||
body_template = E'Hi {{.UserName}}\n\n,' || -- add comma | ||
E'Your workspace **{{.Labels.name}}** has been marked as [**dormant**](https://coder.com/docs/templates/schedule#dormancy-threshold-enterprise) because of {{.Labels.reason}}.\n' || | ||
E'Dormant workspaces are [automatically deleted](https://coder.com/docs/templates/schedule#dormancy-auto-deletion-enterprise) after {{.Labels.timeTilDormant}} of inactivity.\n' || | ||
E'To prevent deletion, use your workspace with the link below.' | ||
WHERE | ||
id = '0ea69165-ec14-4314-91f1-69566ac3c5a0'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'Hi {{.UserName}}', 'Hi {{.UserName}},')::text | ||
body_template = E'Hi {{.UserName}}\n\n,' || -- add comma | ||
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' || | ||
E'To prevent deletion, use your workspace with the link below.' | ||
WHERE | ||
id = '51ce2fdf-c9ca-4be1-8d70-628674f9bc42'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'The workspace build was initiated by', E'\nThe workspace build was initiated by')::text | ||
body_template = E'Hi {{.UserName}},\n\n' || | ||
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 = REPLACE(body_template::text, 'Hi {{.UserName}},', E'Hi {{.UserName}},\n')::text | ||
WHERE | ||
id = '1a6a6bea-ee0a-43e2-9e7c-eabdb53730e4'; | ||
|
||
UPDATE notification_templates | ||
SET | ||
body_template = REPLACE(body_template::text, 'Hi {{.UserName}},', E'Hi {{.UserName}},\n')::text | ||
WHERE | ||
id = '6a2f0609-9b69-4d36-a989-9f5925b6cbff'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
Hi Bobby, | ||
Hi Bobby | ||
|
||
The template **bobby-template** was deleted by **rob**. | ||
The template **bobby-template** was deleted by **rob**. | ||
|
||
The templates display name was **Bobby's Template**. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
Hi Bobby, | ||
|
||
User account **bobby** has been activated. | ||
User account **bobby** has been activated. | ||
|
||
The newly activated account belongs to **william tables** and was activated by **rob**. | ||
Comment on lines
+3
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have we considered a bit different phrase?
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
Hi Bobby, | ||
|
||
New user account **bobby** has been created. | ||
New user account **bobby** has been created. | ||
|
||
This new user account was created for **<no value>** by **<no value>** | ||
SasSwart marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
Hi Bobby, | ||
|
||
User account **bobby** has been deleted. | ||
User account **bobby** has been deleted. | ||
|
||
The deleted account belonged to **william tables** and was deleted by **rob**. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curious, if we can make notifications Any ideas, @dannykopping? Should we involve Christin? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd be keen for a professional Wordsmith to have a look if we want. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree, we should involve @EdwardAngert. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can do this in a follow-up. Let's get this merged. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
Hi Bobby, | ||
|
||
User account **bobby** has been suspended. | ||
User account **bobby** has been suspended. | ||
|
||
The newly suspended account belongs to **william tables** and was suspended by **rob**. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Hi Bobby, | ||
Hi Bobby | ||
|
||
Automatic build of your workspace **bobby-workspace** failed. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Hi Bobby, | ||
Hi Bobby | ||
|
||
Your workspace **bobby-workspace** has been marked as [**dormant**](https://coder.com/docs/templates/schedule#dormancy-threshold-enterprise) because of breached the template's threshold for inactivity. | ||
,Your workspace **bobby-workspace** has been marked as [**dormant**](https://coder.com/docs/templates/schedule#dormancy-threshold-enterprise) because of breached the template's threshold for inactivity. | ||
SasSwart marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Dormant workspaces are [automatically deleted](https://coder.com/docs/templates/schedule#dormancy-auto-deletion-enterprise) after 24 hours of inactivity. | ||
To prevent deletion, use your workspace with the link below. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Hi Bobby, | ||
Hi Bobby | ||
|
||
Your workspace **bobby-workspace** has been marked for **deletion** after 24 hours of [dormancy](https://coder.com/docs/templates/schedule#dormancy-auto-deletion-enterprise) because of template updated to new dormancy policy. | ||
,Your workspace **bobby-workspace** has been marked for **deletion** after 24 hours of [dormancy](https://coder.com/docs/templates/schedule#dormancy-auto-deletion-enterprise) because of template updated to new dormancy policy. | ||
To prevent deletion, use your workspace with the link below. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Hi Bobby, | ||
|
||
Your account **bobby** has been activated. | ||
Your account **bobby** has been activated by **rob**. |
Uh oh!
There was an error while loading. Please reload this page.