Skip to main content

SendEmailWithTemplateRequest

Struct SendEmailWithTemplateRequest 

Source
pub struct SendEmailWithTemplateRequest {
Show 15 fields pub from: String, pub to: String, pub template_id: Option<i64>, pub template_alias: Option<String>, pub template_model: TemplateModel, pub cc: Option<String>, pub bcc: Option<String>, pub tag: Option<String>, pub reply_to: Option<String>, pub headers: Option<Vec<Header>>, pub track_opens: Option<bool>, pub track_links: Option<TrackLink>, pub attachments: Option<Vec<Attachment>>, pub metadata: Option<HashMap<String, String>>, pub message_stream: Option<String>,
}
Expand description

Send a Single email with a template.

let mut model = TemplateModel::default();
model.insert("name", "Ferris");

let req = SendEmailWithTemplateRequest::builder()
  .from("me@example.com")
  .to("you@example.com")
  .template_model(model)
  .build();

Fields§

§from: String

The sender email address. Must have a registered and confirmed Sender Signature. To include a name, use the format Full Name <sender@domain.com> for the address.

§to: String

Recipient email address. Multiple addresses are comma separated. Max 50.

§template_id: Option<i64>

The template ID. One of template_id or template_alias must be provided.

§template_alias: Option<String>

The template alias. One of template_id or template_alias must be provided.

§template_model: TemplateModel

The template model.

§cc: Option<String>

Cc recipient email address. Multiple addresses are comma separated. Max 50.

§bcc: Option<String>

Bcc recipient email address. Multiple addresses are comma separated. Max 50.

§tag: Option<String>

Email tag that allows you to categorize outgoing emails and get detailed statistics.

§reply_to: Option<String>

Reply To override email address. Defaults to the Reply To set in the sender signature.

§headers: Option<Vec<Header>>

List of custom headers to include.

§track_opens: Option<bool>

Activate open tracking for this email.

§track_links: Option<TrackLink>

Activate link tracking for links in the HTML or Text bodies of this email.

§attachments: Option<Vec<Attachment>>

List of attachments

§metadata: Option<HashMap<String, String>>

Custom metadata key/value pairs.

§message_stream: Option<String>

Set message stream ID that’s used for sending. If not provided, message will default to the “outbound” transactional stream.

Implementations§

Source§

impl SendEmailWithTemplateRequest

Source

pub fn builder() -> SendEmailWithTemplateRequestBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>

Create a builder for building SendEmailWithTemplateRequest. On the builder, call .from(...), .to(...), .template_id(...)(optional), .template_alias(...)(optional), .template_model(...)(optional), .cc(...)(optional), .bcc(...)(optional), .tag(...)(optional), .reply_to(...)(optional), .headers(...)(optional), .track_opens(...)(optional), .track_links(...)(optional), .attachments(...)(optional), .metadata(...)(optional), .message_stream(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of SendEmailWithTemplateRequest.

Trait Implementations§

Source§

impl Clone for SendEmailWithTemplateRequest

Source§

fn clone(&self) -> SendEmailWithTemplateRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SendEmailWithTemplateRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SendEmailWithTemplateRequest

Source§

fn default() -> SendEmailWithTemplateRequest

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SendEmailWithTemplateRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Endpoint for SendEmailWithTemplateRequest

Source§

type Request = SendEmailWithTemplateRequest

Source§

type Response = SendEmailResponse

Source§

fn endpoint(&self) -> Cow<'static, str>

The path to the endpoint.
Source§

fn body(&self) -> &Self::Request

The body for the endpoint.
Source§

fn method(&self) -> Method

The http method for the endpoint
Source§

impl PartialEq for SendEmailWithTemplateRequest

Source§

fn eq(&self, other: &SendEmailWithTemplateRequest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SendEmailWithTemplateRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SendEmailWithTemplateRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, C> Query<C> for T
where T: Endpoint + Send + Sync, C: Client + Send + Sync,

Source§

type Result = Result<<T as Endpoint>::Response, QueryError<<C as Client>::Error>>

Returns the endpoint response or the client error.

Source§

fn execute<'life0, 'async_trait>( self, client: &'life0 C, ) -> Pin<Box<dyn Future<Output = <T as Query<C>>::Result> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Perform the query against the client.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,