pub struct Email {
pub from: EmailAddress,
pub to: SmallVec<EmailAddress, 1>,
pub reply_to: Option<SmallVec<EmailAddress, 1>>,
pub cc: SmallVec<EmailAddress, 0>,
pub bcc: SmallVec<EmailAddress, 0>,
pub mkind: String,
pub content: EmailContent,
}
Expand description
add an email to the offline email queue, so that the email can be sent later. these emails get picked up by the email worker.
§Arguments
from
- EmailAddressto
- smallvec::SmallVec<EmailAddress, 1>cc
,bcc
- smallvec::SmallVec<EmailAddress, 0>mkind
- mkind is any string, used for product analytics, etc. the value should be dotted, e.g., x.y.z to capture hierarchy. ideally you should usemarketing.
as the prefix for all marketing related emails, and anything else for transaction mails, so your mailer can use appropriate channels./<app-url>/mail/<mkind>/
is the endpoint where the email content is fetched from.content
: EmailContent
Fields§
§from: EmailAddress
§to: SmallVec<EmailAddress, 1>
§reply_to: Option<SmallVec<EmailAddress, 1>>
§cc: SmallVec<EmailAddress, 0>
§bcc: SmallVec<EmailAddress, 0>
§mkind: String
§content: EmailContent
Implementations§
Source§impl Email
impl Email
pub fn new( from: EmailAddress, to: EmailAddress, mkind: &str, content: EmailContent, ) -> Email
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Email
impl<'de> Deserialize<'de> for Email
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Email, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Email, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Email
impl Serialize for Email
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Email
impl RefUnwindSafe for Email
impl Send for Email
impl Sync for Email
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read more