automate schnupper mails
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m15s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
2024-05-22 08:30:38 +02:00
parent 3ebde6afce
commit 71c228f202
3 changed files with 70 additions and 8 deletions

View File

@ -20,7 +20,7 @@ impl Mail {
subject: &str,
body: String,
smtp_pw: &str,
) {
) -> Result<(), String> {
let mut email = Message::builder()
.from(
"ASKÖ Ruderverein Donau Linz <no-reply@rudernlinz.at>"
@ -45,6 +45,9 @@ impl Mail {
format!("Mail not sent to {single_rec}, because it could not be parsed"),
)
.await;
return Err(format!(
"Mail nicht versandt, da '{single_rec}' keine gültige Mailadresse ist."
));
}
}
}
@ -64,6 +67,8 @@ impl Mail {
// Send the email
mailer.send(&email).unwrap();
Ok(())
}
pub async fn send(db: &SqlitePool, data: MailToSend<'_>, smtp_pw: String) -> bool {