15 releases (7 breaking)

0.10.0 Nov 21, 2023
0.9.0 Aug 31, 2023
0.8.1 Jun 14, 2023
0.6.0 Feb 13, 2023
0.3.0 Jul 31, 2021

#83 in HTTP client

Download history 272/week @ 2024-01-17 168/week @ 2024-01-24 150/week @ 2024-01-31 171/week @ 2024-02-07 494/week @ 2024-02-14 1132/week @ 2024-02-21 2181/week @ 2024-02-28 1621/week @ 2024-03-06 1093/week @ 2024-03-13 1233/week @ 2024-03-20 786/week @ 2024-03-27 1009/week @ 2024-04-03 1010/week @ 2024-04-10 628/week @ 2024-04-17 423/week @ 2024-04-24 312/week @ 2024-05-01

2,592 downloads per month

MIT/Apache

68KB
1.5K 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::reqwest::PostmarkClient;
use postmark::api::email::{SendEmailRequest,Body};

async fn send_email(){
  let client = PostmarkClient::builder()
   .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 is heavily inspired by the article "Designing Rust bindings for REST APIs by Ben Boeckel.

License

postmark is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

Dependencies

~3–15MB
~222K SLoC