Crates.io | postal_api |
lib.rs | postal_api |
version | 0.2.1 |
source | src |
created_at | 2023-08-21 17:54:07.513466 |
updated_at | 2023-08-25 15:41:13.178747 |
description | A Rust implementation for the Postal mail delivery platform. |
homepage | |
repository | https://codeberg.org/OpenThingies/postal_api |
max_upload_size | |
id | 950252 |
size | 21,868 |
postal_api is an API Wrapper for the Postal Mail delivery service. It takes inspiration from postal-node, trying to add additional validation into the MessageBuilder where possible.
just simply run:
cargo add postal_api
or add the following to your Cargo.toml:
postal_api = "0.2.0"
Usage is quite simple:
use postal_api::PostalClient;
use postal_api::message::MessageBuilder;
// create a postal client
let client = PostalClient::new(
"http://example.com".to_string(),
"my_super_secret_api_key".to_string()
);
// set only things we require to send a message at all
let message = MessageBuilder::new()
.add_to("someone@example.com")
.unwrap()
.set_from("me@example2.com")
.set_plain_body("HELLO WORLD!")
.build()
.unwrap();
client.send_message(message);
This project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in postal_api by you, shall be licensed as MIT, without any additional terms or conditions.