Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pastjean/postmark-rs
Postmark client for rust
https://github.com/pastjean/postmark-rs
email postmark rust
Last synced: 6 days ago
JSON representation
Postmark client for rust
- Host: GitHub
- URL: https://github.com/pastjean/postmark-rs
- Owner: pastjean
- License: apache-2.0
- Created: 2021-08-25T13:09:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-03T14:34:21.000Z (4 months ago)
- Last Synced: 2025-01-02T13:11:49.205Z (13 days ago)
- Topics: email, postmark, rust
- Language: Rust
- Homepage: https://docs.rs/postmark
- Size: 85.9 KB
- Stars: 11
- Watchers: 1
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Postmark
[![ci](https://github.com/pastjean/postmark-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/pastjean/postmark-rs/actions/workflows/ci.yml)
[![crates.io](https://img.shields.io/crates/v/postmark.svg)](https://crates.io/crates/postmark)
[![Documentation](https://docs.rs/postmark/badge.svg)](https://docs.rs/postmark)
[![License](https://img.shields.io/crates/l/postmark.svg)](https://github.com/pastjean/postmark-rust#license)A rust library to query Postmark API.
# Usage
Add the crate dependency to your Cargo.toml:
```toml
[dependencies]
postmark = "x.y.z"
```And use it, see documentation at: https://docs.rs/postmark.
```rust
use postmark::reqwest::PostmarkClient;
use postmark::api::email::{SendEmailRequest,Body};async fn send_email(){
let client = PostmarkClient::builder()
.server_token("")
.build();let req = SendEmailRequest::builder()
.from("[email protected]")
.to("[email protected]")
.body(Body::text("it's me, Mario!".to_string()))
.build();
let resp = req.execute(&client).await;
}
```# Releasing a new version
Prerequisite:
```sh
cargo install cargo-release
```On Release:
```sh
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](https://plume.benboeckel.net/~/JustAnotherBlog/designing-rust-bindings-for-rest-ap-is) by Ben Boeckel.
# License
postmark is distributed under the terms of both the MIT license and the Apache License (Version 2.0).