Struct MailSettingsBuilder

Source
pub struct MailSettingsBuilder { /* private fields */ }
Expand description

Builder pattern for creating MailSettings Make sure you call build() to consume this builder and get the underlying MailSettings Construct with default().

Implementations§

Source§

impl MailSettingsBuilder

Source

pub fn bcc(self, email: impl Into<String>) -> Self

Adds the BCC setting to the MailSettings struct. It will always be enabled if this is called. Just specify the email address to BCC.

§Examples

let builder = MailSettingsBuilder::default()
              .bcc("bcc@example.com");
Source

pub fn bypass_list_management(self) -> Self

Turns on the flag for bypass_list_management in MailSettings.

§Examples

let builder = MailSettingsBuilder::default()
              .bypass_list_management();
Source

pub fn footer(self, text: Option<String>, html: Option<String>) -> Self

Adds a footer to MailSettings text form is the optional first parameter, and html is the second. Enabled flag is set to true when this method is called.

§Examples

let builder = MailSettingsBuilder::default()
              .footer(Some(String::from("text footer")), Some(String::from("<h1>HTML Footer</h1>")));
Source

pub fn sandbox_mode(self) -> Self

Enables the sandbox_mode flag for MailSettings

§Examples

let builder = MailSettingsBuilder::default()
              .sandbox_mode();
Source

pub fn spam_check( self, threshold: Option<i32>, post_to_url: Option<String>, ) -> Self

Configures the spam_check node for MailSettings

§Parameters

threshold: Option post_to_url: Option

§Examples

let builder = MailSettingsBuilder::default()
              .spam_check(Some(5), Some(String::from("http://post_url")));
Source

pub fn build(self) -> MailSettings

Consumes the MailSettingsBuilder and returns the underlying MailSettings

§Examples

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

Trait Implementations§

Source§

impl Default for MailSettingsBuilder

Source§

fn default() -> MailSettingsBuilder

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

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> 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, 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.