[][src]Struct sparkpost::transmission::Transmission

pub struct Transmission { /* fields omitted */ }

Sparkpost Transmission currently only supports sending email message

use sparkpost::transmission::Transmission;
let tm = Transmission::new("api_key_form_env".to_string());

for more info see https://developers.sparkpost.com/api/transmissions/

Methods

impl Transmission[src]

pub fn new<T: Into<String>>(api_key: T) -> Self[src]

creates new Transmission with api key for global version

pub fn new_eu<T: Into<String>>(api_key: T) -> Self[src]

creates new Transmission with api key for EU version

pub fn send(&self, message: &Message) -> Result<TransmissionResponse, ReqError>[src]

Send api request

pub fn scheduled_by_id(
    &self,
    transmission_id: &str
) -> Result<TransmissionResponse, ReqError>
[src]

Retrieve a Scheduled Transmission from API

pub fn scheduled_transmissions(
    &self,
    header_map: Option<&HashMap<&'static str, &str>>
) -> Result<TransmissionResponse, ReqError>
[src]

Retrieve all Scheduled Transmissions from API

Example

use sparkpost::transmission::Transmission;
use std::collections::HashMap;
let tm = Transmission::new("api_key");

let mut headers = HashMap::new();
headers.insert("campaign_id", "your_campaingn_id");
headers.insert("template_id", "your_template_id");

// filter with headers
let transmissions = tm.scheduled_transmissions(Some(&headers));

// or for all transmissions
let transmissions = tm.scheduled_transmissions(None);

Trait Implementations

impl Debug for Transmission[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.