You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
Remove dependency on mas-email and lettre in mas-config
This commit is contained in:
@ -35,16 +35,16 @@ impl Mailer {
|
||||
/// Constructs a new [`Mailer`]
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
templates: &Templates,
|
||||
transport: &MailTransport,
|
||||
from: &Mailbox,
|
||||
reply_to: &Mailbox,
|
||||
templates: Templates,
|
||||
transport: MailTransport,
|
||||
from: Mailbox,
|
||||
reply_to: Mailbox,
|
||||
) -> Self {
|
||||
Self {
|
||||
templates: templates.clone(),
|
||||
transport: transport.clone(),
|
||||
from: from.clone(),
|
||||
reply_to: reply_to.clone(),
|
||||
templates,
|
||||
transport,
|
||||
from,
|
||||
reply_to,
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,4 +110,13 @@ impl Mailer {
|
||||
self.transport.send(message).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Test the connetion to the mail server
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the connection failed
|
||||
pub async fn test_connection(&self) -> Result<(), anyhow::Error> {
|
||||
self.transport.test_connection().await
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user