Skip to content

template

konigle.models.comm.email.template

Email template models for the Konigle SDK.

Email templates allow users to create reusable email content with variable placeholders for dynamic content insertion. Templates belong to an email account and can be used for sending consistent, branded communications.

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.

BaseEmailTemplate

Bases: BaseModel

body_html = Field(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='', title='Text Body Template', description='Plain text body template (optional).') class-attribute instance-attribute

Plain text body template (optional).

code = Field(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=False, 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(title='Template Name', description='Name of the email template.', max_length=255) class-attribute instance-attribute

Name of the email template.

subject = Field(title='Subject Template', description='Subject line template with variable placeholders.') class-attribute instance-attribute

Subject line template with variable placeholders.

tags = Field(default_factory=list, title='Tags', description='List of tags for categorizing the template.') class-attribute instance-attribute

List of tags for categorizing the template.

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

Bases: BaseEmailTemplate, CreateModel

Model for creating a new email template.

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.