Crate postal_api

source ·
Expand description

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

This is currently in early development and mainly for internal Use.

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

Basic usage

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

Modules

Structs