feat(server): email notifications
- SMTP transport is validated when SMTP settings are changed.
- SMTP settings available in the WEB-UI
- React-Mail template engine. It has built in components to provide modern web to "old" table based layout common in emails and text/plain email.
- It is possible to view the rendered templates in real-time by running
npm run email:devin the server directory. This just ned the dependencies to be installed and does not require the full server to be running. - This can also be integrated with tailwind and generate email templates from already available classes.
- Simple notification triggered when an user is created from the
POSTrequest to/userendpoint. - Option to skip sending welcome email when creating a new user
Known issues:
- To generate server side URLs it is required to have the Server url configured. There is no handler right now if this fails the job also does.
Screenshots
Admin settings
Create user form
Welcome email template
The library we're using will automatically upgrade to smtps if the mail server indicates it support the STARTTLS extension.
https://www.nodemailer.com/smtp/#tls-options
automatically upgrade to smtps
This feels prone to breakage or MITM attacks. Is there a way to enforce it, something like a toggle to reject plaintext connections or such?
automatically upgrade to smtps
This feels prone to breakage or MITM attacks. Is there a way to enforce it, something like a toggle to reject plaintext connections or such?
Yes there is. So maybe enable that by default and have a toggle that optionally allows for insecure connections?
FWIW it seems nextcloud does the same thing, there option is None/STARTTLS, so presumably they also auto upgrade
I would be happy if we could add documentation to this. I hope to have some time to document this, can you put your name on Discord for me in case I have questions?