pub struct Email { /* private fields */ }Expand description
A validated email ready to send.
Implementations§
Source§impl Email
impl Email
Sourcepub fn html<A>(
to: A,
subject: impl Into<String>,
body: impl Into<String>,
) -> Result<Self>
pub fn html<A>( to: A, subject: impl Into<String>, body: impl Into<String>, ) -> Result<Self>
Creates an HTML email for a single recipient.
Sourcepub fn html_many<I>(
to: I,
subject: impl Into<String>,
body: impl Into<String>,
) -> Result<Self>where
I: IntoIterator<Item = EmailAddress>,
pub fn html_many<I>(
to: I,
subject: impl Into<String>,
body: impl Into<String>,
) -> Result<Self>where
I: IntoIterator<Item = EmailAddress>,
Creates an HTML email for multiple recipients.
Sourcepub fn template<A>(to: A, template_id: impl Into<String>) -> Result<Self>
pub fn template<A>(to: A, template_id: impl Into<String>) -> Result<Self>
Creates a template email for a single recipient.
template_id must be the Plunk template UUID, not the template name.
Sourcepub fn template_many<I>(to: I, template_id: impl Into<String>) -> Result<Self>where
I: IntoIterator<Item = EmailAddress>,
pub fn template_many<I>(to: I, template_id: impl Into<String>) -> Result<Self>where
I: IntoIterator<Item = EmailAddress>,
Creates a template email for multiple recipients.
template_id must be the Plunk template UUID, not the template name.
pub fn from<A>(self, from: A) -> Result<Self>
pub fn reply_to<A>(self, reply_to: A) -> Result<Self>
pub fn with_header( self, key: impl Into<String>, value: impl Into<String>, ) -> Result<Self>
pub fn with_data<T>(self, data: T) -> Result<Self>where
T: Serialize,
pub fn recipients(&self) -> &[EmailAddress]
pub fn from_address(&self) -> Option<&EmailAddress>
pub fn reply_to_address(&self) -> Option<&EmailAddress>
pub fn subject(&self) -> Option<&str>
pub fn body(&self) -> Option<&str>
pub fn template_id(&self) -> Option<&str>
pub fn headers(&self) -> &BTreeMap<String, String>
pub fn data(&self) -> &Map<String, Value>
Trait Implementations§
impl Eq for Email
impl StructuralPartialEq for Email
Auto Trait Implementations§
impl Freeze for Email
impl RefUnwindSafe for Email
impl Send for Email
impl Sync for Email
impl Unpin for Email
impl UnsafeUnpin for Email
impl UnwindSafe for Email
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more