18 releases

0.11.0 Sep 3, 2024
0.10.2 Jul 29, 2024
0.10.1 Jun 21, 2024
0.10.0 Nov 21, 2023
0.3.0 Jul 31, 2021

#73 in HTTP client

Download history 1446/week @ 2024-07-27 1365/week @ 2024-08-03 757/week @ 2024-08-10 933/week @ 2024-08-17 935/week @ 2024-08-24 843/week @ 2024-08-31 1179/week @ 2024-09-07 1085/week @ 2024-09-14 1159/week @ 2024-09-21 1323/week @ 2024-09-28 808/week @ 2024-10-05 1000/week @ 2024-10-12 807/week @ 2024-10-19 867/week @ 2024-10-26 833/week @ 2024-11-02 781/week @ 2024-11-09

3,377 downloads per month

MIT/Apache

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

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 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

~4–15MB
~188K SLoC