[−][src]Struct sparkpost::transmission::Transmission
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]
&self,
transmission_id: &str
) -> Result<TransmissionResponse, ReqError>
Retrieve a Scheduled Transmission from API
pub fn scheduled_transmissions(
&self,
header_map: Option<&HashMap<&'static str, &str>>
) -> Result<TransmissionResponse, ReqError>
[src]
&self,
header_map: Option<&HashMap<&'static str, &str>>
) -> Result<TransmissionResponse, ReqError>
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
Auto Trait Implementations
impl !RefUnwindSafe for Transmission
impl Send for Transmission
impl Sync for Transmission
impl Unpin for Transmission
impl !UnwindSafe for Transmission
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,