21 releases

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 Jul 31, 2021

#79 in HTTP client

Download history 946/week @ 2025-02-03 1263/week @ 2025-02-10 1896/week @ 2025-02-17 2003/week @ 2025-02-24 2376/week @ 2025-03-03 2645/week @ 2025-03-10 3183/week @ 2025-03-17 1843/week @ 2025-03-24 3262/week @ 2025-03-31 2891/week @ 2025-04-07 1887/week @ 2025-04-14 1480/week @ 2025-04-21 1795/week @ 2025-04-28 2042/week @ 2025-05-05 1686/week @ 2025-05-12 1164/week @ 2025-05-19

6,737 downloads per month
Used in 2 crates (via atuin-server)

MIT/Apache

97KB
2K SLoC

Postmark

ci crates.io Documentation License

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:

at your option.

Dependencies

~4–16MB
~196K SLoC