[][src]Struct sendgrid_rs::personalization::PersonalizationBuilder

pub struct PersonalizationBuilder { /* fields omitted */ }

Builder pattern for Personalization. Make sure you call build() when done to consume this and return the underlying Personalization. Use default() to construct.

Methods

impl PersonalizationBuilder
[src]

pub fn to(self, contact: Contact) -> Self
[src]

Add a To contact. Use ContactBuilder to construct this.

Examples


let builder = PersonalizationBuilder::default()
              .to(ContactBuilder::new("to@example.com").build());

pub fn cc(self, contact: Contact) -> Self
[src]

Add a CC contact. Use ContactBuilder to construct this.

Examples


let builder = PersonalizationBuilder::default()
              .cc(ContactBuilder::new("cc@example.com").build());

pub fn bcc(self, contact: Contact) -> Self
[src]

Add a BCC contact. Use ContactBuilder to construct this.

Examples


let builder = PersonalizationBuilder::default()
              .bcc(ContactBuilder::new("bcc@example.com").build());

pub fn subject(
    self,
    subject: impl Into<String>
) -> Self
[src]

Set a custom subject line.

Examples


let builder = PersonalizationBuilder::default()
              .subject("Subject line");

pub fn header<S: Into<String>>(self, key: S, value: S) -> Self
[src]

Set an email header.

Parameters

key: impl Into value: impl Into

Examples


let builder = PersonalizationBuilder::default()
              .header("Key", "Value");

pub fn headers(self, data: HashMap<String, String>) -> Self
[src]

Assign multiple email headers

Parameters

data: HashMap<String, String>

Examples


let headers: HashMap<String, String> = HashMap::new();
let builder = PersonalizationBuilder::default()
.headers(headers);

pub fn substitution<S: Into<String>>(self, key: S, value: S) -> Self
[src]

Set a substitution

Parameters

key: impl Into value: impl Into

Examples


let builder = PersonalizationBuilder::default()
              .substitution("Key", "Value");

pub fn dynamic_template_datum<S: Into<String>>(self, key: S, value: S) -> Self
[src]

Add a single dynamic template substitution

Parameters

key: impl Into value: impl Into

Examples


let builder = PersonalizationBuilder::default()
              .dynamic_template_datum("Key", "Value");

pub fn dynamic_template_data(self, data: HashMap<String, String>) -> Self
[src]

Assign multiple dynamic template substitutions, overwriting all synamic template substitutions with supplied data

Parameters

data: HashMap<String, String>

Examples


let substitutions: HashMap<String, String> = HashMap::new();
let builder = PersonalizationBuilder::default()
              .dynamic_template_data(substitutions);

pub fn custom_arg<S: Into<String>>(self, key: S, value: S) -> Self
[src]

Set a custom_arg

Parameters

key: impl Into value: impl Into

Examples


let builder = PersonalizationBuilder::default()
              .custom_arg("Key", "Value");

pub fn send_at(self, time: i32) -> Self
[src]

Set a send_at time in seconds

Examples


let builder = PersonalizationBuilder::default()
              .send_at(3600);

pub fn build(self) -> Personalization
[src]

Consume the builder and return the underlying 'Personalization'

Examples


let builder = PersonalizationBuilder::default()
              .build();

Trait Implementations

impl Default for PersonalizationBuilder
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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