0
0
Fork 0
mirror of https://git.verdigado.com/NB-Public/simple-wkd.git synced 2024-12-06 14:52:41 +01:00

Improve mail text and add logger

This commit is contained in:
Delta1925 2023-04-14 16:33:59 +02:00
parent 1a85cb77fa
commit b717852376
No known key found for this signature in database
GPG key ID: 1C21ACE44193CB25
6 changed files with 96 additions and 11 deletions

View file

@ -67,8 +67,23 @@ pub fn send_confirmation_email(email: &str, action: &Action, token: &str) -> Res
Ok(mailbox) => mailbox,
Err(_) => return Err(Error::ParseEmail),
})
.subject(&SETTINGS.mail_settings.mail_subject)
.body(format!("{action} - {token}"));
.subject(
SETTINGS
.mail_settings
.mail_subject
.replace("%a", &action.to_string().to_lowercase()),
)
.body(format!(
"{}",
SETTINGS
.external_url
.join("api/")
.unwrap()
.join("confirm/")
.unwrap()
.join(token)
.unwrap()
));
let message = match email {
Ok(message) => message,