zero-to-production/src/email_client.rs

24 lines
409 B
Rust
Raw Normal View History

2021-01-10 17:27:54 +00:00
use crate::domain::SubscriberEmail;
2021-01-11 09:37:04 +00:00
use reqwest::Client;
2021-01-10 17:27:54 +00:00
2021-01-11 09:37:04 +00:00
pub struct EmailClient {
http_client: Client,
}
2021-01-10 17:27:54 +00:00
impl EmailClient {
2021-01-11 09:37:04 +00:00
pub fn new() -> Self {
Self {
http_client: Client::new(),
}
}
2021-01-10 17:27:54 +00:00
pub async fn send_email(
&self,
recipient: SubscriberEmail,
subject: &str,
content: &str,
) -> Result<(), String> {
todo!()
}
}