21 releases
new 0.11.3 | Apr 28, 2025 |
---|---|
0.11.1 | Mar 2, 2025 |
0.11.0 | Sep 3, 2024 |
0.10.2 | Jul 29, 2024 |
0.3.0 |
|
#73 in HTTP client
9,568 downloads per month
Used in 2 crates
(via atuin-server)
97KB
2K
SLoC
Postmark
A rust library to query Postmark API.
Usage
Add the crate dependency to your Cargo.toml:
[dependencies]
postmark = "x.y.z"
And use it, see documentation at: https://docs.rs/postmark.
use postmark::api::email::SendEmailRequest;
use postmark::api::Body;
use postmark::reqwest::PostmarkClient;
use postmark::Query;
async fn send_email(){
let client = PostmarkClient::builder()
.server_token("<sometoken>")
.build();
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;
}
Releasing a new version
Prerequisite:
cargo install cargo-release
On Release:
cargo release --dry-run
# check it does the good thing
cargo release
Thanks
This crate's API design is heavily inspired by the article "Designing Rust bindings for REST APIs by Ben Boeckel.
License
postmark-rs is dual-licensed under either:
- MIT License (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)
at your option.
Dependencies
~4–16MB
~191K SLoC