From a8e943c9a7abbde95c900d89fc5f2ed825e9afa3 Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 23 Jan 2021 08:58:42 +0100 Subject: Fix mail sending The error was due to the utilization of the special character “—” in the subject, with postfix’ sendmail. Also directly use process commands to get async support. --- src/jobs/weekly_report.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/jobs') 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); -- cgit v1.2.3