8 releases (4 breaking)
0.7.0 | May 23, 2023 |
---|---|
0.6.0 | Feb 13, 2023 |
0.5.0 | Apr 22, 2022 |
0.4.2 | Dec 10, 2021 |
0.3.0 |
|
#73 in Email
387 downloads per month
35KB
684 lines
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::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–11MB
~232K SLoC