comm
konigle.models.comm
¶
Communication models for the Konigle SDK.
This module provides models for email, SMS, WhatsApp, and other communication channels supported by the Konigle platform.
Audience
¶
Bases: BaseAudience, TimestampedResource
Contact segment definition based on tags for campaign targeting.
Audiences enable marketers to create targeted segments of contacts based on tags for use in email campaigns and other marketing activities.
code = Field(title='Audience Code', description='Unique code for the audience (slug format).', max_length=100, pattern='^[a-z0-9]+(?:-[a-z0-9]+)*$')
class-attribute
instance-attribute
¶
Unique code for the audience.
AudienceCreate
¶
Bases: BaseAudience, CreateModel
Model for creating a new audience.
code = Field(default=None, title='Audience Code', description='Unique code for the audience (slug format).', max_length=100, pattern='^[a-z0-9]+(?:-[a-z0-9]+)*$')
class-attribute
instance-attribute
¶
Unique code for the audience. If not provided, it will be auto-generated based on the name.
AudienceUpdate
¶
Bases: UpdateModel
Model for updating an existing audience.
code = Field(default=None, title='Audience Code', description='Unique code for the audience (slug format).', max_length=100, pattern='^[a-z0-9]+(?:-[a-z0-9]+)*$')
class-attribute
instance-attribute
¶
Unique code for the audience.
description = Field(default=None, title='Description', description='Description of the audience segment.')
class-attribute
instance-attribute
¶
Description of the audience segment.
name = Field(default=None, title='Audience Name', description='Name of the audience segment.', max_length=255)
class-attribute
instance-attribute
¶
Name of the audience segment.
tags = Field(default=None, title='Tags', description='Tags to filter contacts for this audience.')
class-attribute
instance-attribute
¶
Tags to filter contacts for this audience.
Campaign
¶
Bases: BaseCampaign, TimestampedResource
Campaign configuration for sending messages across multiple channels.
Currently supports email campaigns. Designed to support additional channels (WhatsApp, SMS, etc.) in the future.
execution = Field(default=None, title='Execution Details', description='Execution tracking details (available in detail view).')
class-attribute
instance-attribute
¶
Execution tracking details (available in detail view).
ltv = Field(default=None, title='Lifetime Value', description='Lifetime value (revenue) generated by this campaign.', max_digits=12, decimal_places=2)
class-attribute
instance-attribute
¶
Lifetime value (revenue) generated by this campaign.
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).
status = Field(default='draft', title='Status', description='Current status of the campaign.')
class-attribute
instance-attribute
¶
Current status of the campaign.
CampaignAddLTV
¶
Bases: BaseModel
Model for adding LTV to a campaign.
Records revenue generated from a specific contact purchase and updates both campaign and contact LTV.
contact_email = Field(default=None, title='Contact Email', description='Email address of the contact who made the purchase. Optional if tracking aggregate campaign revenue.')
class-attribute
instance-attribute
¶
Email address of the contact who made the purchase.
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.
value = Field(title='LTV Value', description='Value to add to campaign and contact LTV (positive).', gt=0, max_digits=19, decimal_places=2)
class-attribute
instance-attribute
¶
Value to add to campaign and contact LTV (must be positive).
CampaignCreate
¶
CampaignCreateEmail
¶
Bases: BaseModel
Model for creating an email campaign with audience and template.
This is a hybrid API that creates a campaign along with its associated audience and email template in a single operation.
audience_name = Field(default='', title='Audience Name', description='Name for audience (defaults to campaign_name).', max_length=255)
class-attribute
instance-attribute
¶
Name for audience (defaults to campaign_name).
body_html = Field(title='HTML Body', description='HTML body content.')
class-attribute
instance-attribute
¶
HTML body content.
body_text = Field(default='', title='Text Body', description='Plain text body content.')
class-attribute
instance-attribute
¶
Plain text body content.
campaign_name = Field(title='Campaign Name', description='Name of the campaign.', max_length=255)
class-attribute
instance-attribute
¶
Name of the campaign.
contact_tags = Field(title='Contact Tags', description='List of tags to filter contacts for audience.')
class-attribute
instance-attribute
¶
List of tags to filter contacts for audience.
description = Field(default='', title='Description', description='Campaign description.')
class-attribute
instance-attribute
¶
Campaign description.
email_channel = Field(title='Email Channel Code', description='Code of email channel to use.', max_length=50)
class-attribute
instance-attribute
¶
Code of email channel to use.
execution_duration_minutes = Field(default=None, title='Execution Duration (Minutes)', description='Duration in minutes to spread campaign sends.', ge=1, le=1440)
class-attribute
instance-attribute
¶
Duration in minutes to spread campaign sends.
from_email = Field(default='', title='From Email', description='Override from email.')
class-attribute
instance-attribute
¶
Override from email.
from_name = Field(default='', title='From Name', description='Override from name. Required if account does not have default.', max_length=255)
class-attribute
instance-attribute
¶
Override from name. Required if account does not have default.
reply_to_email = Field(default='', title='Reply-To Email', description='Override reply-to email. Required if account does not have default.')
class-attribute
instance-attribute
¶
Override reply-to email. Required if account does not have default.
reply_to_name = Field(default='', title='Reply-To Name', description='Override reply-to name. Required if account does not have default.', max_length=255)
class-attribute
instance-attribute
¶
Override reply-to name. Required if account does not have default.
scheduled_at = Field(default=None, title='Scheduled At', description='When to send the campaign.')
class-attribute
instance-attribute
¶
When to send the campaign.
subject = Field(title='Email Subject', description='Email subject line.', max_length=255)
class-attribute
instance-attribute
¶
Email subject line.
template_name = Field(default='', title='Template Name', description='Name for email template (defaults to campaign_name).', max_length=255)
class-attribute
instance-attribute
¶
Name for email template (defaults to campaign_name).
utm_code = Field(default='', title='UTM Code', description='UTM campaign code for tracking.', max_length=100)
class-attribute
instance-attribute
¶
UTM campaign code for tracking.
CampaignExecution
¶
Bases: BaseModel
Track execution of a campaign with process and status.
Provides real-time tracking of campaign delivery progress, including send rates, delivery metrics, and error tracking.
cancelled_at = Field(default=None, title='Cancelled At', description='When the execution was cancelled (if applicable).')
class-attribute
instance-attribute
¶
When the execution was cancelled (if applicable).
completed_at = Field(default=None, title='Completed At', description='When execution completed.')
class-attribute
instance-attribute
¶
When execution completed.
error_message = Field(default='', title='Error Message', description='Error message if execution failed.')
class-attribute
instance-attribute
¶
Error message if execution failed.
expected_completion_at = Field(default=None, title='Expected Completion At', description='Expected completion time based on execution duration.')
class-attribute
instance-attribute
¶
Expected completion time based on execution duration.
last_run_at = Field(default=None, title='Last Run At', description='When the last run completed for calculating send rate.')
class-attribute
instance-attribute
¶
When the last run completed for calculating send rate.
next_run_at = Field(default=None, title='Next Run At', description='When to run the next execution (for HALTED executions).')
class-attribute
instance-attribute
¶
When to run the next execution (for HALTED executions).
paused_at = Field(default=None, title='Paused At', description='When the execution was paused (if applicable).')
class-attribute
instance-attribute
¶
When the execution was paused (if applicable).
resumed_at = Field(default=None, title='Resumed At', description='When the execution was last resumed after being paused.')
class-attribute
instance-attribute
¶
When the execution was last resumed after being paused.
started_at = Field(default=None, title='Started At', description='When execution started.')
class-attribute
instance-attribute
¶
When execution started.
status = Field(default='pending', title='Execution Status', description='Current execution status.')
class-attribute
instance-attribute
¶
Current execution status.
total_bounced = Field(default=0, title='Total Bounced', description='Number of messages bounced (from events).')
class-attribute
instance-attribute
¶
Number of messages bounced (from events).
total_clicked = Field(default=None, title='Total Clicked', description='Number of messages with clicks (from events).')
class-attribute
instance-attribute
¶
Number of messages with clicks (from events). NULL if not tracked.
total_complained = Field(default=0, title='Total Complained', description='Number of spam complaints (from events).')
class-attribute
instance-attribute
¶
Number of spam complaints (from events).
total_contacts = Field(default=0, title='Total Contacts', description='Total number of contacts to send to.')
class-attribute
instance-attribute
¶
Total number of contacts to send to.
total_delivered = Field(default=0, title='Total Delivered', description='Number of messages delivered (from events).')
class-attribute
instance-attribute
¶
Number of messages delivered (from events).
total_failed = Field(default=0, title='Total Failed', description='Number of messages that failed to send.')
class-attribute
instance-attribute
¶
Number of messages that failed to send.
total_opened = Field(default=None, title='Total Opened', description='Number of messages opened (from events).')
class-attribute
instance-attribute
¶
Number of messages opened (from events). NULL if not tracked.
total_sent = Field(default=0, title='Total Sent', description='Number of messages successfully sent.')
class-attribute
instance-attribute
¶
Number of messages successfully sent.
CampaignUpdate
¶
Bases: UpdateModel
Model for updating an existing campaign.
Note: ltv and ltv_currency are managed automatically by the system based on campaign performance and cannot be updated directly. Status transitions are handled by separate action endpoints.
Campaign can only be updated when in draft and scheduled states. This does not hold for name and description which can be updated at any time.
audience = Field(default=None, title='Audience ID', description='Target audience segment for this campaign.')
class-attribute
instance-attribute
¶
Target audience segment for this campaign.
description = Field(default=None, title='Description', description='Description of the campaign purpose.')
class-attribute
instance-attribute
¶
Description of the campaign purpose.
email_channel = Field(default=None, title='Email Channel ID', description='Channel to use for sending emails.')
class-attribute
instance-attribute
¶
Channel to use for sending emails.
email_template = Field(default=None, title='Email Template ID', description='Email template to use.')
class-attribute
instance-attribute
¶
Email template to use.
execution_duration_minutes = Field(default=None, title='Execution Duration (Minutes)', description='Duration in minutes over which to spread campaign sends (max 1440).', ge=1, le=1440)
class-attribute
instance-attribute
¶
Duration in minutes over which to spread campaign sends.
from_email = Field(default=None, title='From Email', description='Override from email.')
class-attribute
instance-attribute
¶
Override from email.
from_name = Field(default=None, title='From Name', description='Override from name.', max_length=255)
class-attribute
instance-attribute
¶
Override from name.
name = Field(default=None, title='Campaign Name', description='Name of the campaign.', max_length=255)
class-attribute
instance-attribute
¶
Name of the campaign.
reply_to_email = Field(default=None, title='Reply-To Email', description='Override reply-to email.')
class-attribute
instance-attribute
¶
Override reply-to email.
reply_to_name = Field(default=None, title='Reply-To Name', description='Override reply-to name.', max_length=255)
class-attribute
instance-attribute
¶
Override reply-to name.
scheduled_at = Field(default=None, title='Scheduled At', description='When to send the campaign.')
class-attribute
instance-attribute
¶
When to send the campaign.
utm_code = Field(default=None, title='UTM Code', description='UTM campaign code for tracking.', max_length=100)
class-attribute
instance-attribute
¶
UTM campaign code for tracking.
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).
Email
¶
Bases: CreateModel
Model for sending direct emails through the Konigle email service.
Not supporting cc and bcc since they don't represent the use case of sending transactional emails and marketing emails.
attachments = Field(default=None, title='Attachments', description='Optional file attachments (max 10 files). Can be file paths, bytes, BytesIO, BinaryIO, or tuples of (file_data, filename).', max_length=10)
class-attribute
instance-attribute
¶
Optional file attachments (max 10 files).
body_html = Field(title='HTML Body', description='HTML body content.')
class-attribute
instance-attribute
¶
HTML body content.
body_text = Field(default=None, title='Text Body', description='Plain text body content (optional).')
class-attribute
instance-attribute
¶
Plain text body content (optional).
category = Field(default=None, title='Category', description='Notification category code for the email. If present, the email will not be sent if the to_email is unsubscribed from the category.', max_length=50)
class-attribute
instance-attribute
¶
Notification category code for the email.
channel = Field(title='Channel', description='Channel code to use for sending the email.', max_length=20)
class-attribute
instance-attribute
¶
Channel code to use for sending the email.
from_email = Field(default=None, title='From Email', description='From email address to override the Account.default_from_email.')
class-attribute
instance-attribute
¶
From email address to override the Account.default_from_email.
headers = Field(default=None, title='Custom Headers', description='Optional custom headers to include in the email.')
class-attribute
instance-attribute
¶
Optional custom headers to include in the email.
reply_to_email = Field(default=None, title='Reply-To Email', description='Optional reply-to email address. Overrides Account.default_reply_to_email.')
class-attribute
instance-attribute
¶
Optional reply-to email address. Overrides Account.default_reply_to_email.
save_as_template = Field(default=False, title='Save as Template', description='Whether to save the email as a template for future use.')
class-attribute
instance-attribute
¶
Whether to save the email as a template for future use.
subject = Field(title='Subject', description='Email subject line.', max_length=255)
class-attribute
instance-attribute
¶
Email subject line.
to_email = Field(title='To Email', description='Primary recipient email addresses.', min_length=1)
class-attribute
instance-attribute
¶
Primary recipient email addresses.
normalize_attachments()
¶
Normalize attachments to FileInputT.
validate_attachments(v)
classmethod
¶
Validate attachment files.
validate_headers(v)
classmethod
¶
Validate custom headers.
EmailAccount
¶
Bases: BaseEmailAccount, TimestampedResource
Email account for a website.
Each website gets one email account that contains the default email configuration and serves as the parent for email channels and identities.
is_active = Field(default=True, title='Is Active', description='Whether the email account is active and can be used.')
class-attribute
instance-attribute
¶
Whether the email account is active.
EmailAccountCreate
¶
EmailAccountSetup
¶
Bases: BaseModel
Model for setting up an email account with initial configuration.
account_name = Field(title='Account Name', description='Name of the email account.', max_length=255)
class-attribute
instance-attribute
¶
Name of the email account.
default_from_email = Field(title='Default From Email', description='Default from email address for this account.')
class-attribute
instance-attribute
¶
Default from email address.
default_reply_to_email = Field(default=None, title='Default Reply-To Email', description='Default reply-to email address.')
class-attribute
instance-attribute
¶
Default reply-to email address.
identity_value = Field(title='Identity Value', description='Email address or domain to verify as an identity.', max_length=255)
class-attribute
instance-attribute
¶
Email address or domain to verify as an identity.
EmailAccountUpdate
¶
Bases: UpdateModel
Model for updating an existing email account.
default_from_email = Field(default=None, title='Default From Email', description='Default from email address for this account.')
class-attribute
instance-attribute
¶
Default from email address.
default_from_name = Field(default=None, title='Default From Name', description='Default from name for email headers.', max_length=255)
class-attribute
instance-attribute
¶
Default from name.
default_reply_to_email = Field(default=None, title='Default Reply-To Email', description='Default reply-to email address.')
class-attribute
instance-attribute
¶
Default reply-to email address.
default_reply_to_name = Field(default=None, title='Default Reply-To Name', description='Default reply-to name for email headers.', max_length=255)
class-attribute
instance-attribute
¶
Default reply-to name.
name = Field(default=None, title='Account Name', description='Name of the email account.', max_length=255)
class-attribute
instance-attribute
¶
Name of the email account.
EmailChannel
¶
Bases: BaseEmailChannel, TimestampedResource
Email channel for different types of emails within an account.
Channels separate different email flows (transactional, marketing, etc.) and provide individual configuration and rate limiting.
account = Field(title='Account ID', description='ID of the email account this channel belongs to.')
class-attribute
instance-attribute
¶
Email account this channel belongs to.
daily_quota = Field(default=1000, title='Daily Quota', description='Daily email quota for this channel.', ge=1)
class-attribute
instance-attribute
¶
Daily email quota for this channel.
enable_engagement_tracking = Field(default=False, title='Engagement Tracking', description='Whether engagement tracking (open and click) is enabled for this channel.')
class-attribute
instance-attribute
¶
Whether engagement tracking is enabled for this channel.
rate_limit = Field(default=10, title='Rate Limit', description='Rate limit (emails per second) for this channel.', ge=1, le=20)
class-attribute
instance-attribute
¶
Rate limit (emails per second) for this channel.
status = Field(default=(EmailChannelStatus.ACTIVE), title='Channel Status', description='Current status of the channel.')
class-attribute
instance-attribute
¶
Current status of the channel.
suspended_at = Field(default=None, title='Suspended At', description='When the channel was suspended.')
class-attribute
instance-attribute
¶
When the channel was suspended.
suspension_reason = Field(default=None, title='Suspension Reason', description='Reason for suspension if applicable.', max_length=255)
class-attribute
instance-attribute
¶
Reason for suspension if applicable.
EmailChannelCreate
¶
EmailChannelStatus
¶
Bases: str, Enum
Status of an email channel.
EmailChannelType
¶
Bases: str, Enum
Types of email channels available.
BROADCAST = 'broadcast'
class-attribute
instance-attribute
¶
Broadcast emails like announcements, updates.
MARKETING = 'marketing'
class-attribute
instance-attribute
¶
Marketing emails like newsletters, promotions.
TRANSACTIONAL = 'transactional'
class-attribute
instance-attribute
¶
Transactional emails like order confirmations, password resets.
EmailChannelUpdate
¶
Bases: UpdateModel
Model for updating an existing email channel.
code = Field(default=None, title='Channel Code', description='Unique code for the channel used when sending emails.', max_length=50)
class-attribute
instance-attribute
¶
Unique code for the channel given by the user that is used to refer to when sending the emails.
EmailIdentity
¶
Bases: TimestampedResource
Identities (domains or email addresses) for sending emails.
Identities must be verified before they can be used to send emails. This includes DKIM and SPF verification for domains.
account = Field(title='Account ID', description='ID of the email account this identity belongs to.')
class-attribute
instance-attribute
¶
Email account this identity belongs to.
dkim_records = Field(default_factory=list, title='DKIM Records', description='DKIM DNS records to be added for verification.')
class-attribute
instance-attribute
¶
DKIM DNS records to be added for verification.
dkim_verification_status = Field(default=(EmailVerificationStatus.PENDING), title='DKIM Verification Status', description='DKIM verification status.')
class-attribute
instance-attribute
¶
DKIM verification status.
dkim_verified = Field(default=False, title='DKIM Verified', description='Whether DKIM is verified.')
class-attribute
instance-attribute
¶
Whether DKIM is verified.
identity_type = Field(title='Identity Type', description='Type of identity (domain or email).')
class-attribute
instance-attribute
¶
Type of identity (domain or email).
identity_value = Field(title='Identity Value', description='The domain or email address value.', max_length=255)
class-attribute
instance-attribute
¶
The domain or email address value.
mail_from_domain = Field(default=None, title='MAIL FROM Domain', description='Custom MAIL FROM domain used for envelope sender.', max_length=255)
class-attribute
instance-attribute
¶
Custom MAIL FROM domain used for envelope sender.
mail_from_records = Field(default_factory=list, title='MAIL FROM Records', description='MAIL FROM DNS records to be added for verification.')
class-attribute
instance-attribute
¶
MAIL FROM DNS records to be added for verification.
mail_from_verification_status = Field(default=(EmailVerificationStatus.PENDING), title='MAIL FROM Verification Status', description='MAIL FROM domain verification status. This is SPF verification status.')
class-attribute
instance-attribute
¶
MAIL FROM domain verification status. This is SPF verification status.
mail_from_verified = Field(default=False, title='MAIL FROM Verified', description='Whether MAIL FROM domain is verified.')
class-attribute
instance-attribute
¶
Whether MAIL FROM domain is verified.
use_custom_mail_from = Field(default=False, title='Use Custom MAIL FROM', description='Whether to use custom MAIL FROM domain.')
class-attribute
instance-attribute
¶
Whether to use custom MAIL FROM domain.
verified = Field(default=False, title='Verified', description='Whether the identity is verified for sending emails.')
class-attribute
instance-attribute
¶
Whether the identity is verified for sending emails.
EmailIdentityCreate
¶
Bases: CreateModel
Model for creating a new email identity.
identity_value = Field(title='Identity Value', description='The domain or email address value.', max_length=255)
class-attribute
instance-attribute
¶
The domain or email address value.
EmailIdentityType
¶
EmailIdentityUpdate
¶
Bases: UpdateModel
Model for updating an existing email identity.
use_custom_mail_from = Field(default=None, title='Use Custom MAIL FROM', description='Whether to use custom MAIL FROM domain.')
class-attribute
instance-attribute
¶
Whether to use custom MAIL FROM domain.
EmailResponse
¶
Bases: BaseModel
Response model for successful email send operations.
message_id = Field(default=None, title='Email Message ID', description='Unique identifier for the sent email')
class-attribute
instance-attribute
¶
Unique identifier for the sent email
status = Field(title='Status', description='Status code of the email send operation.')
class-attribute
instance-attribute
¶
Status code of the email send operation.
template_id = Field(default=None, title='Template ID', description='ID of the created template (if save_as_template was True).')
class-attribute
instance-attribute
¶
ID of the created template (if save_as_template was True).
EmailTemplate
¶
Bases: BaseEmailTemplate, TimestampedResource
Email template for reusable email content.
Templates do not support any context as of now except for built in context
unsubscribe_link if the email is sent to a single recipient.
The template must be in valid Jinja2 format.
account = Field(title='Account ID', description='ID of the email account this template belongs to.')
class-attribute
instance-attribute
¶
ID of the email account this template belongs to.
preview_url = Field(default=None, title='Preview URL', description='URL to preview the rendered email template.')
class-attribute
instance-attribute
¶
URL to preview the rendered email template.
EmailTemplateCreate
¶
EmailTemplateUpdate
¶
Bases: UpdateModel
Model for updating an existing email template.
body_html = Field(default=None, title='HTML Body Template', description='HTML body template with variable placeholders.')
class-attribute
instance-attribute
¶
HTML body template with variable placeholders.
body_text = Field(default=None, title='Text Body Template', description='Plain text body template (optional).')
class-attribute
instance-attribute
¶
Plain text body template (optional).
code = Field(default=None, title='Template Code', description='Unique code for the template.', max_length=100)
class-attribute
instance-attribute
¶
Unique code for the template.
is_base = Field(default=None, title='Is Base Template', description='Indicates if this is a base template set for the account.')
class-attribute
instance-attribute
¶
Indicates if this is a base template set for the account.
name = Field(default=None, title='Template Name', description='Name of the email template.', max_length=255)
class-attribute
instance-attribute
¶
Name of the email template.
subject = Field(default=None, title='Subject Template', description='Subject line template with variable placeholders.')
class-attribute
instance-attribute
¶
Subject line template with variable placeholders.
tags = Field(default=None, title='Tags', description='List of tags for categorizing the template.')
class-attribute
instance-attribute
¶
List of tags for categorizing the template.
EmailVerificationStatus
¶
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.