fix: typo
This commit is contained in:
@@ -221,7 +221,7 @@ impl ContactApi {
|
||||
let email = Message::builder()
|
||||
.from(self.settings.try_sender_into_mailbox()?)
|
||||
.reply_to(request.try_into()?)
|
||||
.to(self.settings.try_recpient_into_mailbox()?)
|
||||
.to(self.settings.try_recipient_into_mailbox()?)
|
||||
.subject(format!("Contact Form: {}", request.name))
|
||||
.header(ContentType::TEXT_PLAIN)
|
||||
.body(email_body)?;
|
||||
|
||||
+3
-3
@@ -168,7 +168,7 @@ impl EmailSettings {
|
||||
/// - The email address format is invalid
|
||||
/// - The email address contains invalid characters
|
||||
/// - The email address structure is malformed
|
||||
pub fn try_recpient_into_mailbox(
|
||||
pub fn try_recipient_into_mailbox(
|
||||
&self,
|
||||
) -> Result<lettre::message::Mailbox, crate::errors::ContactError> {
|
||||
Ok(self.recipient.parse::<lettre::message::Mailbox>()?)
|
||||
@@ -696,7 +696,7 @@ mod tests {
|
||||
tls: false,
|
||||
};
|
||||
|
||||
let result = settings.try_recpient_into_mailbox();
|
||||
let result = settings.try_recipient_into_mailbox();
|
||||
assert!(result.is_ok());
|
||||
let mailbox = result.unwrap();
|
||||
assert_eq!(mailbox.email.to_string(), "recipient@example.com");
|
||||
@@ -715,7 +715,7 @@ mod tests {
|
||||
tls: false,
|
||||
};
|
||||
|
||||
let result = settings.try_recpient_into_mailbox();
|
||||
let result = settings.try_recipient_into_mailbox();
|
||||
assert!(result.is_err());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user