#email #postal #api-wrapper #send-email #delivery #service #api-error

postal_api

A Rust implementation for the Postal mail delivery platform

3 unstable releases

0.2.1 Aug 25, 2023
0.2.0 Aug 22, 2023
0.1.0 Aug 21, 2023

#7 in #delivery

MIT license

21KB
408 lines

postal_api

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.

Roadmap

  • Messages
    • Builder for Raw Messages
    • Builder for Messages
    • Attachments
  • Send Messages
    • Send Message
    • Send Raw Message
  • Postal API Errors
    • Auth Errors
    • Message Errors
    • Raw Message Errors

Installation

just simply run:

cargo add postal_api

or add the following to your Cargo.toml:

postal_api = "0.2.0"

Usage

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

License

This project is licensed under the MIT license.

Contribution

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.

Dependencies

~3–19MB
~243K SLoC