commit 61279cd551cd6646abdfe7ba83baee1b3c812318 from: Hugo Osvaldo Barrera via: witcher date: Mon Dec 12 20:45:12 2022 UTC Trace-log sending of individual messages commit - fb83c33f22d15742d176370c4fe6886a272fc78c commit + 61279cd551cd6646abdfe7ba83baee1b3c812318 blob - d895b9f7effb754fc346479f3f8b44070dd22096 blob + 382609ac9d796546fb759ca0b9db925273b11e3a --- src/mail.rs +++ src/mail.rs @@ -23,7 +23,7 @@ pub async fn send_email( config: &Config, subject: S, body: I, - mailer: AsyncSmtpTransport, + mailer: &AsyncSmtpTransport, ) -> anyhow::Result<()> where S: AsRef, @@ -35,6 +35,7 @@ where .subject(subject.as_ref()) .body(body.into())?; + trace!("Sending to {}: {}", config.to, subject.as_ref()); mailer.send(email).await?; Ok(()) blob - 9d30382720404549952280e0f4482a6b6ddfe4c2 blob + 08122d0dfbebdcc9b4ce95b4c33de3a92e0b3d6a --- src/main.rs +++ src/main.rs @@ -115,7 +115,7 @@ where Some(c) => c + "\n\n" + &post.url.unwrap(), None => post.url.unwrap(), }; - send_email(&config, subject, body, mailer).await?; + send_email(&config, subject, body, &mailer).await?; } sqlx::query!("update posts set sent = true where guid = ?", post.guid)