contact
konigle.models.comm.contact
¶
Contact models for the Konigle SDK.
Contact information of individuals for email marketing, including purchase history, consent preferences, and customer data.
BaseContact
¶
Bases: BaseModel
Base contact model with shared fields.
country = Field(default='', title='Country', description='Country name of the contact.', max_length=100)
class-attribute
instance-attribute
¶
Country name of the contact.
email = Field(title='Email Address', description='Email address of the contact.')
class-attribute
instance-attribute
¶
Email address of the contact.
first_name = Field(default='', title='First Name', description='First name of the contact.', max_length=100)
class-attribute
instance-attribute
¶
First name of the contact.
last_name = Field(default='', title='Last Name', description='Last name of the contact.', max_length=100)
class-attribute
instance-attribute
¶
Last name of the contact.
marketing_consent = Field(default_factory=MarketingConsent, title='Marketing Consent', description='Marketing consent preferences (email, sms, whatsapp).')
class-attribute
instance-attribute
¶
Marketing consent preferences (email, sms, whatsapp).
phone = Field(default='', title='Phone Number', description='Phone number of the contact.', max_length=20)
class-attribute
instance-attribute
¶
Phone number of the contact.
source = Field(default='unknown', title='Contact Source', description='Source of the contact (purchase, lead, migration, unknown).')
class-attribute
instance-attribute
¶
Source of the contact (purchase, lead, migration, or unknown).
tags = Field(default_factory=list, title='Tags', description='Tags associated with the contact for organization.')
class-attribute
instance-attribute
¶
Tags associated with the contact.
whatsapp = Field(default='', title='WhatsApp Number', description='WhatsApp number of the contact.', max_length=20)
class-attribute
instance-attribute
¶
WhatsApp number of the contact.
Contact
¶
Bases: BaseContact, TimestampedResource
Contact information for email marketing.
Represents an individual contact with their personal information, consent preferences, purchase history, and customer data for email marketing campaigns.
customer_id = Field(default='', title='Customer ID', description='Customer ID from the e-commerce system.', max_length=40)
class-attribute
instance-attribute
¶
Customer ID from the e-commerce system.
last_purchased_at = Field(default=None, title='Last Purchase Date', description='When the contact last made a purchase.')
class-attribute
instance-attribute
¶
When the contact last made a purchase.
ltv = Field(default=None, title='Lifetime Value', description='Lifetime value of the contact.', max_digits=19, decimal_places=2)
class-attribute
instance-attribute
¶
Lifetime value of the contact.
ltv_currency = Field(default='USD', title='LTV Currency', description='Currency code for lifetime value (ISO 4217).', max_length=3)
class-attribute
instance-attribute
¶
Currency code for lifetime value (ISO 4217).
ContactCreate
¶
ContactUpdate
¶
Bases: UpdateModel
Model for updating an existing contact.
Note: ltv, ltv_currency, and last_purchased_at are managed automatically by the system based on purchases and cannot be updated directly.
country = Field(default=None, title='Country', description='Country name of the contact.', max_length=100)
class-attribute
instance-attribute
¶
Country name of the contact.
email = Field(default=None, title='Email Address', description='Email address of the contact.')
class-attribute
instance-attribute
¶
Email address of the contact.
first_name = Field(default=None, title='First Name', description='First name of the contact.', max_length=100)
class-attribute
instance-attribute
¶
First name of the contact.
last_name = Field(default=None, title='Last Name', description='Last name of the contact.', max_length=100)
class-attribute
instance-attribute
¶
Last name of the contact.
marketing_consent = Field(default=None, title='Marketing Consent', description='Marketing consent preferences (email, sms, whatsapp).')
class-attribute
instance-attribute
¶
Marketing consent preferences (email, sms, whatsapp).
phone = Field(default=None, title='Phone Number', description='Phone number of the contact.', max_length=20)
class-attribute
instance-attribute
¶
Phone number of the contact.
source = Field(default=None, title='Contact Source', description='Source of the contact (purchase, lead, migration, unknown).')
class-attribute
instance-attribute
¶
Source of the contact (purchase, lead, migration, or unknown).
tags = Field(default=None, title='Tags', description='Tags associated with the contact for organization.')
class-attribute
instance-attribute
¶
Tags associated with the contact.
whatsapp = Field(default=None, title='WhatsApp Number', description='WhatsApp number of the contact.', max_length=20)
class-attribute
instance-attribute
¶
WhatsApp number of the contact.
ContactUpdateLTV
¶
Bases: BaseModel
Model for updating contact LTV.
Adds revenue to a contact's lifetime value, typically from a purchase or transaction.
currency = Field(title='Currency', description='Currency code (ISO 4217) for the LTV value.', max_length=3)
class-attribute
instance-attribute
¶
Currency code (ISO 4217) for the LTV value.
email = Field(title='Contact Email', description='Email address of the contact to update.')
class-attribute
instance-attribute
¶
Email address of the contact to update.
value = Field(title='LTV Value', description="Value to add to the contact's LTV (positive).", gt=0, max_digits=19, decimal_places=2)
class-attribute
instance-attribute
¶
Value to add to the contact's LTV (must be positive).
MarketingConsent
¶
Bases: BaseModel
Marketing consent preferences for different channels.
Tracks whether a contact has consented to receive marketing communications through email, SMS, and WhatsApp.
email = Field(default=True, title='Email Consent', description='Whether contact has consented to email marketing.')
class-attribute
instance-attribute
¶
Email marketing consent.
sms = Field(default=True, title='SMS Consent', description='Whether contact has consented to SMS marketing.')
class-attribute
instance-attribute
¶
SMS marketing consent.
whatsapp = Field(default=True, title='WhatsApp Consent', description='Whether contact has consented to WhatsApp marketing.')
class-attribute
instance-attribute
¶
WhatsApp marketing consent.