pub struct CreateEmailBaseOptions { /* private fields */ }Expand description
All requisite components and associated data to send an email.
See docs.
Implementations§
Source§impl CreateEmailBaseOptions
impl CreateEmailBaseOptions
Sourcepub fn new<T, A>(
from: impl Into<String>,
to: T,
subject: impl Into<String>,
) -> Self
pub fn new<T, A>( from: impl Into<String>, to: T, subject: impl Into<String>, ) -> Self
Creates a new CreateEmailBaseOptions.
from: Sender email address. To include a friendly name, use the format:Your Name <sender@domain.com>.to: Recipient email addresses. Max 50.subject: Email subject.
Sourcepub fn with_text(self, text: &str) -> Self
pub fn with_text(self, text: &str) -> Self
Adds or overwrites the plain text version of the message.
Sourcepub fn with_reply(self, to: &str) -> Self
pub fn with_reply(self, to: &str) -> Self
Adds another reply_to address to the email.
Sourcepub fn with_reply_multiple(self, to: &[String]) -> Self
pub fn with_reply_multiple(self, to: &[String]) -> Self
Append multiple reply_to addresses to the email.
Sourcepub fn with_header(self, name: &str, value: &str) -> Self
pub fn with_header(self, name: &str, value: &str) -> Self
Adds an email header.
Sourcepub fn with_attachment(self, file: impl Into<CreateAttachment>) -> Self
pub fn with_attachment(self, file: impl Into<CreateAttachment>) -> Self
Adds another attachment.
Limited to max 40mb per email.
Sourcepub fn with_attachments(
self,
new_attachments: impl IntoIterator<Item = impl Into<CreateAttachment>>,
) -> Self
pub fn with_attachments( self, new_attachments: impl IntoIterator<Item = impl Into<CreateAttachment>>, ) -> Self
Adds multiple attachments.
Limited to max 40mb per email.
Sourcepub fn with_template(self, template: impl Into<EmailTemplate>) -> Self
pub fn with_template(self, template: impl Into<EmailTemplate>) -> Self
Adds the template to use for the email.
Sourcepub fn with_topic(self, topic_id: &str) -> Self
pub fn with_topic(self, topic_id: &str) -> Self
Sets the topic ID to receive the email.
Sourcepub fn with_scheduled_at(self, scheduled_at: &str) -> Self
pub fn with_scheduled_at(self, scheduled_at: &str) -> Self
Schedule email to be sent later. The date should be in ISO 8601 format
(e.g: 2024-08-05T11:52:01.858Z).
pub fn with_idempotency_key(self, idempotency_key: &str) -> Idempotent<Self>
Trait Implementations§
Source§impl Clone for CreateEmailBaseOptions
impl Clone for CreateEmailBaseOptions
Source§fn clone(&self) -> CreateEmailBaseOptions
fn clone(&self) -> CreateEmailBaseOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CreateEmailBaseOptions
impl Debug for CreateEmailBaseOptions
Source§impl From<CreateEmailBaseOptions> for Idempotent<CreateEmailBaseOptions>
impl From<CreateEmailBaseOptions> for Idempotent<CreateEmailBaseOptions>
Source§fn from(value: CreateEmailBaseOptions) -> Self
fn from(value: CreateEmailBaseOptions) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CreateEmailBaseOptions
impl RefUnwindSafe for CreateEmailBaseOptions
impl Send for CreateEmailBaseOptions
impl Sync for CreateEmailBaseOptions
impl Unpin for CreateEmailBaseOptions
impl UnsafeUnpin for CreateEmailBaseOptions
impl UnwindSafe for CreateEmailBaseOptions
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