forgot password: send emails

This commit is contained in:
Philippe Loctaux 2023-04-22 01:27:24 +02:00
parent 751a21485f
commit feb9f16bc9
10 changed files with 676 additions and 18 deletions

36
crates/email/readme.md Normal file
View file

@ -0,0 +1,36 @@
# email
create and send emails from templates
## template
- `mjml` to create emails
- `tera` to render emails with parameters
## send
- `lettre` to send the emails with smtp
## rocket config
- `from`: Sender of emails, usually name and email address
- `transport`: Security method to send the mails. `unencrypted` or `tls` or `starttls`
- `host`: Where to send smtp traffic
- `port`: *optional*: Used when `transport` is `unencrypted`
- `username` and `password`: *optional*: Used when `transport` is `tls` or `starttls`
### `Rocket.toml`
```toml
[default.email]
from = "ezidam <ezidam@mail.local>"
transport = "unencrypted"
host = "localhost"
port = 1025
```
### env
```dotenv
ROCKET_EMAIL='{from="ezidam <ezidam@mail.local>",transport="unencrypted",host="localhost",port=1025}'
```