A rust library to query Postmark API.
Add the crate dependency to your Cargo.toml:
toml
[dependencies]
postmark = "x.y.z"
And use it, see documentation at: https://docs.rs/postmark.
```rust use postmark::reqwest::PostmarkClient; use postmark::api::email::{SendEmailRequest,Body};
async fn send_email(){
let client = PostmarkClient::builder()
.token("
let req = SendEmailRequest::builder() .from("me@example.com") .to("you@example.com") .body(Body::Text("it's me, Mario!".to_string())) .build(); let resp = req.execute(&client).await; } ```
Prerequisite:
sh
cargo install cargo-release
On Release:
```sh cargo release --dry-run
cargo release ```
This crate is heavily inspired by the article "Designing Rust bindings for REST APIs by Ben Boeckel.
postmark is distributed under the terms of both the MIT license and the Apache License (Version 2.0).