zero-to-production/src/email_client.rs
2021-01-16 15:11:17 +00:00

26 lines
469 B
Rust

use crate::domain::SubscriberEmail;
use reqwest::Client;
pub struct EmailClient {
http_client: Client,
base_url: String,
}
impl EmailClient {
pub fn new(base_url: String) -> Self {
Self {
http_client: Client::new(),
base_url,
}
}
pub async fn send_email(
&self,
recipient: SubscriberEmail,
subject: &str,
content: &str,
) -> Result<(), String> {
todo!()
}
}