From 3e884cac0691ea717e18f0b82afbd970d7111277 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Thu, 9 Jan 2025 01:10:36 +0530 Subject: [PATCH] hotfix: make lettre init sync for use within actix framework init --- .../adapters/output/mailer/lettre/account_validation_link.rs | 2 +- src/identity/adapters/output/mailer/lettre/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/identity/adapters/output/mailer/lettre/account_validation_link.rs b/src/identity/adapters/output/mailer/lettre/account_validation_link.rs index 2e631e9..80a7cb3 100644 --- a/src/identity/adapters/output/mailer/lettre/account_validation_link.rs +++ b/src/identity/adapters/output/mailer/lettre/account_validation_link.rs @@ -51,7 +51,7 @@ mod tests { let validation_secret = "dafsdfasecret"; let settings = crate::settings::tests::get_settings().await; - let m = LettreMailer::new(&settings).await; + let m = LettreMailer::new(&settings); m.account_validation_link(email, username, validation_secret) .await diff --git a/src/identity/adapters/output/mailer/lettre/mod.rs b/src/identity/adapters/output/mailer/lettre/mod.rs index f0e998b..cbb5778 100644 --- a/src/identity/adapters/output/mailer/lettre/mod.rs +++ b/src/identity/adapters/output/mailer/lettre/mod.rs @@ -16,13 +16,13 @@ pub struct LettreMailer { } impl LettreMailer { - pub async fn new(s: &Settings) -> Self { + pub fn new(s: &Settings) -> Self { let mailer: AsyncSmtpTransport = AsyncSmtpTransport::::from_url(s.email.url.as_str()) .unwrap() .build(); - assert!(mailer.test_connection().await.unwrap()); + // assert!(mailer.test_connection().await.unwrap()); Self { mailer,