sparkpost 0.0.2

Rust bindings for sparkpost email api v1
docs.rs failed to build sparkpost-0.0.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: sparkpost-0.5.4

sparkpost

WIP initial release

version 0.0.1 only supports transmission api for sending emails. as sparkpost has a huge api.

Please open an issue on gitlab if you need support or additional features

Usage

[dependencies]
sparkpost = "0.0.2"

Example

extern crate sparkpost;

use sparkpost::{Transmission, Message};

let tm = Transmission::new("api_key".into(), "https://api.eu.sparkpost.com/api/v1".into());
let email: Message = Message::new("sender@yourdomain.com", "Name")
         .add_recipient("name@domain.com", Some("Name"))
         .set_subject("My Awesome email 😎")
         .set_html("<h1>html body of the email</h1>")
         .set_text("text body of the email");
let result = tm.send(&email);

match result {
    OK(response)=>{
        println!("{:#?}", response);
    },
    Err(e) => println("{:#?}", e);
}

TODO

  • send email
  • other api features