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
{{ message }}
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
Currently the text of the emails that Chapter sends is embedded directly in the controllers. If we move them into their own file this both removes clutter from the controllers and makes it easier to audit the text and ensure that it has a consistent voice.
server/src/email-templates.ts seems like a good enough place for these helper functions for now.
Hi @UrielOfir. What I was trying to say was that we should not put the email content directly in the resolvers that handle the user's request. For example
It looks like the constants were moved out of the revolvers in PR #2319, but @ojeytonwilliams 's example above seemed to go further by moving the mailerService.sendEmail out of the resolver.
Activity
UrielOfir commentedon Jan 7, 2023
Hi :)
I would like to assign myself for this issue.
I didn't understand what did you mean that "emails sending is embedded directly in the controllers".
Did you mean to the code in this file-
https://github.com/freeCodeCamp/chapter/blob/08cb5b009187e7ce7530350365b881c37daa8c3e/server/src/controllers/Users/resolver.ts
line 60?
ojeytonwilliams commentedon Jan 9, 2023
Hi @UrielOfir. What I was trying to say was that we should not put the email content directly in the resolvers that handle the user's request. For example
chapter/server/src/controllers/Users/resolver.ts
Lines 60 to 67 in 08cb5b0
bloats the resolver logic. If it read like this
it would be a lot cleaner.
Chirag2193 commentedon Apr 30, 2023
This issue seems to have been merged under above PR #2319
We ok to close this?
allella commentedon Apr 30, 2023
It looks like the constants were moved out of the revolvers in PR #2319, but @ojeytonwilliams 's example above seemed to go further by moving the mailerService.sendEmail out of the resolver.
Oliver, is there more to go done here?