pub struct ContactRequest {
pub is_excluded_from_campaigns: Option<bool>,
pub name: Option<String>,
pub email: Option<String>,
}
Expand description
The contact creation/update request
§Create a contact
use mailjet_api_wrapper::requests::ContactRequest;
use mailjet_api_wrapper::Mailjet;
// Create mailjet client
let mailjet = Mailjet::from_api_keys("your_key", "your_secret");
/// Create new contact
let contact = ContactRequest {
is_excluded_from_campaigns: Some(true),
name: Some("New Contact".to_string()),
email: Some("passenger@mailjet.com".to_string()),
};
/// Execution
let response = mailjet.contact_create(&contact).unwrap_or_default();
§GDPR Delete contacts
use mailjet_api_wrapper::Mailjet;
// Create mailjet client
let mailjet = Mailjet::from_api_keys("your_key", "your_secret");
// Delete contact from id
mailjet.contact_delete(187464256).unwrap_or_default();
Fields§
§is_excluded_from_campaigns: Option<bool>
Indicates whether the contact is added to the exclusion list for campaigns or not
An excluded contact will not be receiving any marketing emails
name: Option<String>
User-selected name for this contact
email: Option<String>
Contact email address
This field is mandatory for creation. Mailjet doesn’t tell you but you can update an email with this
Trait Implementations§
Source§impl Default for ContactRequest
impl Default for ContactRequest
Source§fn default() -> ContactRequest
fn default() -> ContactRequest
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ContactRequest
impl<'de> Deserialize<'de> for ContactRequest
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 ContactRequest
impl RefUnwindSafe for ContactRequest
impl Send for ContactRequest
impl Sync for ContactRequest
impl Unpin for ContactRequest
impl UnwindSafe for ContactRequest
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