feat: make email client send requests

This commit is contained in:
Sandro Eiler 2024-02-27 14:45:40 +01:00
parent ac216925ff
commit c021b989c2

View file

@ -30,7 +30,7 @@ impl EmailClient {
subject: &str,
html_content: &str,
text_content: &str,
) -> Result<(), String> {
) -> Result<(), reqwest::Error> {
// TODO: use `reqwest::Url::join` and change `base_url`'s type from `String` to `reqwest::Url`
let url = format!("{}/email", self.base_url);
let request_body = SendEmailRequest {
@ -47,7 +47,9 @@ impl EmailClient {
"X-Postmark-Server-Token",
self.authorization_token.expose_secret(),
)
.json(&request_body);
.json(&request_body)
.send()
.await?;
Ok(())
}
}