pub struct TemplateOptions {
pub name: String,
pub subject: String,
pub html: String,
pub text: String,
pub preheader: Option<String>,
pub amp_html: Option<String>,
}
Expand description
Options for creating or updating email templates in SendWithUs.
This struct is used when creating new templates or updating existing ones. It contains all the required template content in both HTML and text formats, along with metadata like the template name and subject line.
§Examples
use send_with_us::types::TemplateOptions;
let template = TemplateOptions {
name: "Welcome Email".to_string(),
subject: "Welcome to Our Service".to_string(),
html: "<html><body>Welcome, {{name}}!</body></html>".to_string(),
text: "Welcome, {{name}}!".to_string(),
preheader: Some("Welcome to our service".to_string()),
amp_html: None,
};
Fields§
§name: String
Template name (displayed in the SendWithUs dashboard)
subject: String
Email subject line (can include template variables)
html: String
HTML content of the email (can include template variables)
text: String
Plain text content of the email (can include template variables)
preheader: Option<String>
Preheader text (preview text shown in email clients)
amp_html: Option<String>
AMP HTML content for supported email clients
Trait Implementations§
Source§impl Clone for TemplateOptions
impl Clone for TemplateOptions
Source§fn clone(&self) -> TemplateOptions
fn clone(&self) -> TemplateOptions
Returns a copy of the value. Read more
1.0.0 · 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 TemplateOptions
impl Debug for TemplateOptions
Source§impl<'de> Deserialize<'de> for TemplateOptions
impl<'de> Deserialize<'de> for TemplateOptions
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
Source§impl PartialEq for TemplateOptions
impl PartialEq for TemplateOptions
Source§impl Serialize for TemplateOptions
impl Serialize for TemplateOptions
impl StructuralPartialEq for TemplateOptions
Auto Trait Implementations§
impl Freeze for TemplateOptions
impl RefUnwindSafe for TemplateOptions
impl Send for TemplateOptions
impl Sync for TemplateOptions
impl Unpin for TemplateOptions
impl UnwindSafe for TemplateOptions
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