freeCodeCamp
freeCodeCamp copied to clipboard
feat(api): email service
Checklist:
- [x] I have read and followed the contribution guidelines.
- [x] I have read and followed the how to open a pull request guide.
- [x] My pull request targets the
main
branch of freeCodeCamp. - [x] I have tested these changes either locally on my machine, or GitPod.
With this plugin we can call fastify.sendEmail
whenever we need to. The default email provider is SES, but it falls back to nodemailer in development.
Closes: https://github.com/freeCodeCamp/freeCodeCamp/issues/50498
New dependencies detected. Learn more about Socket for GitHub ↗︎
Packages | Version | New capabilities | Transitives | Size | Publisher |
---|---|---|---|---|---|
@types/nodemailer | 6.4.9 | None | +0 |
89.3 kB | types |
@oliver is this setup automatically during development or does is need to be manually started?
If that's the case it would be nice to have some documentation on how to use it.
is this setup automatically during development or does is need to be manually started?
It's automatic. The EMAIL_PROVIDER
controls it and is set to nodemailer
in development, so new contributors don't have to do anything special.
Existing contributors will have to update their .env files, but that's standard whenever we add a new variable.
Good point, that would not be consistent between dev and prod. We never want to be sending html, correct?
@naomi-lgbt is it as simple as
Text: {
Charset: "UTF-8",
Data: "This is the message body in text format."
}
where I put HTML? This is based on: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SES.html#sendEmail-property
We never want to be sending html, correct?
Yes - that is correct.
@ojeytonwilliams we enabled JSDoc; please rebase when you get a moment and address any linting issues. Thanks.
@naomi-lgbt once you are happy with comments, please resolve them.