Skip to content

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

Merged
merged 23 commits into from
Mar 21, 2025

Conversation

defelmnq
Copy link
Contributor

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.

@defelmnq defelmnq self-assigned this Mar 18, 2025
@defelmnq defelmnq requested review from mafredri and SasSwart March 19, 2025 15:49
@defelmnq
Copy link
Contributor Author

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'.

Copy link
Contributor

@DanielleMaywood DanielleMaywood left a 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

@defelmnq
Copy link
Contributor Author

Thanks @DanielleMaywood for the first review - I fixed the missing templates.
Also gave it a try with generated email and everything is as before in term of formatting.

Screenshot 2025-03-20 at 15 23 24

@defelmnq defelmnq requested a review from mtojek March 20, 2025 14:27
Copy link
Contributor

@DanielleMaywood DanielleMaywood left a 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 👍

@DanielleMaywood
Copy link
Contributor

Apologies for not noticing sooner but another quick read through I've the plaintext golden files are missing the greeting.

https://github.com/coder/coder/blob/d8d4b9b86e1eb8bc6713834966aec858c3bd16ba/coderd/notifications/dispatch/smtp/plaintext.gotmpl

@defelmnq defelmnq marked this pull request as ready for review March 20, 2025 15:33
Copy link
Member

@mtojek mtojek left a 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>
Copy link
Member

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?)

Copy link
Contributor Author

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.

@defelmnq defelmnq requested a review from mtojek March 20, 2025 16:53
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@defelmnq defelmnq merged commit fe24a7a into main Mar 21, 2025
30 checks passed
@defelmnq defelmnq deleted the coder-inbox/internal-448 branch March 21, 2025 15:05
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants