hotfix: make lettre init sync for use within actix framework init
This commit is contained in:
parent
6b3770451e
commit
3e884cac06
2 changed files with 3 additions and 3 deletions
|
@ -51,7 +51,7 @@ mod tests {
|
||||||
let validation_secret = "dafsdfasecret";
|
let validation_secret = "dafsdfasecret";
|
||||||
|
|
||||||
let settings = crate::settings::tests::get_settings().await;
|
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)
|
m.account_validation_link(email, username, validation_secret)
|
||||||
.await
|
.await
|
||||||
|
|
|
@ -16,13 +16,13 @@ pub struct LettreMailer {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LettreMailer {
|
impl LettreMailer {
|
||||||
pub async fn new(s: &Settings) -> Self {
|
pub fn new(s: &Settings) -> Self {
|
||||||
let mailer: AsyncSmtpTransport<Tokio1Executor> =
|
let mailer: AsyncSmtpTransport<Tokio1Executor> =
|
||||||
AsyncSmtpTransport::<Tokio1Executor>::from_url(s.email.url.as_str())
|
AsyncSmtpTransport::<Tokio1Executor>::from_url(s.email.url.as_str())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assert!(mailer.test_connection().await.unwrap());
|
// assert!(mailer.test_connection().await.unwrap());
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
mailer,
|
mailer,
|
||||||
|
|
Loading…
Reference in a new issue