allow to change from schnupperant to scheckbuch
Some checks failed
CI/CD Pipeline / test (push) Has started running
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled

This commit is contained in:
2025-05-03 17:39:03 +02:00
parent 9dfcb4e2c4
commit afc32cc41e
4 changed files with 74 additions and 14 deletions

View File

@@ -189,27 +189,26 @@ impl ScheckbuchUser {
}
// TODO: make private
pub(crate) async fn notify(
&self,
db: &SqlitePool,
mail: &str,
smtp_pw: &str,
) -> Result<(), String> {
self.send_welcome_mail_to_user(db, mail, smtp_pw).await?;
pub(crate) async fn notify(&self, db: &SqlitePool, smtp_pw: &str) -> Result<(), String> {
self.notify_coxes_about_new_scheckbuch(db).await;
self.send_welcome_mail_to_user(db, smtp_pw).await?;
Ok(())
}
async fn send_welcome_mail_to_user(
pub(crate) async fn send_welcome_mail_to_user(
&self,
db: &SqlitePool,
mail: &str,
smtp_pw: &str,
) -> Result<(), String> {
let Some(mail) = &self.mail else {
return Err(
"Kann Mail nicht versenden, weil der User keine Mailadresse hinterlegt hat.".into(),
);
};
Mail::send_single(
db,
mail,
&mail,
"ASKÖ Ruderverein Donau Linz | Dein Scheckbuch wartet auf Dich",
format!(
"Hallo {0},