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, ) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Email
impl<'de> Deserialize<'de> for Email
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. 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