mirror of
https://github.com/LukeMathWalker/zero-to-production.git
synced 2024-06-11 09:49:23 +00:00
26 lines
469 B
Rust
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!()
|
|
}
|
|
}
|