feat: make email client send requests
This commit is contained in:
parent
ac216925ff
commit
c021b989c2
1 changed files with 4 additions and 2 deletions
|
|
@ -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(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue