diff options
Diffstat (limited to 'src/jobs')
-rw-r--r-- | src/jobs/weekly_report.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/jobs/weekly_report.rs b/src/jobs/weekly_report.rs index 819d30b..b482f0d 100644 --- a/src/jobs/weekly_report.rs +++ b/src/jobs/weekly_report.rs @@ -17,10 +17,17 @@ pub async fn send( let users = db::users::list(pool).await; mail::send( config, - users.into_iter().map(|u| (u.email, u.name)).collect(), - "Budget — rapport hebdomadaire".to_string(), + users + .into_iter() + .map(|u| mail::Recipient { + name: u.name, + address: u.email, + }) + .collect(), + "Rapport hebdomadaire".to_string(), report, ) + .await } Err(err) => { error!("Error preparing weekly report from template: {:?}", err); |