hotfix: make lettre init sync for use within actix framework init

This commit is contained in:
Aravinth Manivannan 2025-01-09 01:10:36 +05:30
parent 6b3770451e
commit 3e884cac06
Signed by: realaravinth
GPG key ID: F8F50389936984FF
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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<Tokio1Executor> =
AsyncSmtpTransport::<Tokio1Executor>::from_url(s.email.url.as_str())
.unwrap()
.build();
assert!(mailer.test_connection().await.unwrap());
// assert!(mailer.test_connection().await.unwrap());
Self {
mailer,