feat: Allow usage of custom SMTP server #1219
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Summary
Mail interaction with service providers was too limiting, and NodeMailer has facilities for handling all kinds of servers. The relevant variables were exposed through the environment and documentation was added.
I initially set this up with Mailjet, by the way, and it worked without issues. So it's not only
gmail
that works, likely all the NodeMailer providers do. But sending a password reset link through these services if iffy from a security perspective if a trusted mail server is available.NOTE: I am unsure what the note regarding the values needing to be set means, I might have fixed that as well but this appears to be something larger?
NOTE: Added an unrelated bit in the
.env
to make the user aware ofDALLE_API_KEY
. Took me way too long to find, this is the first thing I'm doing with JS.Change Type
Please delete any irrelevant options.
!
when checking for mail service caused the form to malfunctionEMAIL_HOST
and related variables for mail configurationTesting
Tested with a variety of values for the env variables, no breaking changes were observed. For complex / odd combinations, the user would have to check the Nodemailer documentation / code to be 100% sure what they all do.
NOTE: I do not consider the inclusion of the
APP_TITLE
and the user's name in the mail addresses breaking - that may be debatable.Test Configuration:
Checklist
Regarding tests, no tests for the password reset exist and the setup would be extensive due to the requirement of a mail server (and a connection to at least one Nodemailer well-known provider).