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:
parent
1a85cb77fa
commit
b717852376
6 changed files with 96 additions and 11 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue