Email Service
Add an option to create mail on the site with admin login, not hardcoded like these
Shared
Section titled “Shared”This is the same service as in the node-server-starter, updates should be in both.
!!!
This should only focus on sending the emails, no routes or handlers. Try to make it as dumb as possible.
Service
Section titled “Service”This service shouldn’t be crafting the emails, such as sendResetPasswordEmail. Instead, users of the service should pass the contents to the service. That way the auth service can make it’s own content for the email service to stick in a template and send.
emailService/index exports
const EmailService = { sendResetPasswordEmail, sendVerificationEmail, sendContactEmail,}config
Section titled “config”-
.env
transport varibles
# EmailSMTP_HOST=mail.elliotreed.netSMTP_PORT=465SMTP_USERNAME=server@elliotreed.netSMTP_PASSWORD=s-3R-v3r.n3tEMAIL_FROM=server@elliotreed.netEMAIL_RECEIVER=test@elliotreed.devEMAIL_TOKEN_EXPIRATION=3600000 -
config/email.config
? empty
-
config/template.config
returns a config object for email properties
this would be better with a database adapter so defaults could be changed from the app. with a fallback to default hard-coded values.