-
Notifications
You must be signed in to change notification settings - Fork 886
feat(coderd): remove greetings from notifications templates #16991
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
Conversation
For context and after discussing with @DanielleMaywood - we could have also done it using some SQL functions - but I preferred instead to rewrite all notifications to have a kind of 'checkpoint' on which we know what all notifications should look like. We had a few migrations to UPDATE the body and it became complicated to track - this migration both removes the greetings and creates this 'checkpoint'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe a couple notifications have been missed
coderd/notifications/testdata/rendered-templates/smtp/TemplateWorkspaceDormant.html.golden
Outdated
Show resolved
Hide resolved
...otifications/testdata/rendered-templates/smtp/TemplateWorkspaceMarkedForDeletion.html.golden
Outdated
Show resolved
Hide resolved
Thanks @DanielleMaywood for the first review - I fixed the missing templates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than this change, looks good to me 👍
Apologies for not noticing sooner but another quick read through I've the plaintext golden files are missing the greeting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only one comment on indentation, otherwise LGTM
@@ -14,6 +14,7 @@ | |||
{{ .Labels._subject }} | |||
</h1> | |||
<div style="line-height: 1.5;"> | |||
<p>Hi {{ .UserName }},</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's fix the indentation (2 spaces?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be better ✅ I also regenerated.
It still creates a few changes on the golden-files which is cool I think as they were not uniformized - not they will be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR aimes to fix this issue -
The main idea is to remove greetings from templates stored in the DB - and instead push it into the template for require methods - for now SMTP.