Skip to content

template

konigle.managers.comm.email.template

Email template managers for the Konigle SDK.

This module provides managers for email template resources, enabling email template management operations including CRUD operations.

AsyncEmailTemplateManager

Bases: BaseEmailTemplateManager, BaseAsyncManager

Asynchronous manager for email template resources.

create(data) async

Create a new email template.

PARAMETER DESCRIPTION
data

Email template creation data including all required fields

TYPE: EmailTemplateCreate

RETURNS DESCRIPTION
EmailTemplate

Created email template instance with Active Record capabilities

Example
template_data = EmailTemplateCreate(
    name="Welcome Email",
    code="welcome-email",
    subject="Welcome to {{company_name}}!",
    body_html="<h1>Welcome!</h1><p>Thanks for joining.</p>",
    body_text="Welcome! Thanks for joining.",
    tags=["welcome", "onboarding"]
)
template = await client.email_templates.create(template_data)
print(f"Created template: {template.name}")

BaseEmailTemplateManager

Base class for email template managers with shared configuration.

base_path = '/reachout/api/v1/email-templates' class-attribute instance-attribute

The API base path for this resource type.

filter_class = EmailTemplateFilters class-attribute instance-attribute

The filter model class for this resource type.

resource_class = EmailTemplate class-attribute instance-attribute

The resource model class this manager handles.

resource_update_class = EmailTemplateUpdate class-attribute instance-attribute

The model class used for updating resources.

EmailTemplateManager

Bases: BaseEmailTemplateManager, BaseSyncManager

Synchronous manager for email template resources.

create(data)

Create a new email template.

PARAMETER DESCRIPTION
data

Email template creation data including all required fields

TYPE: EmailTemplateCreate

RETURNS DESCRIPTION
EmailTemplate

Created email template instance with Active Record capabilities

Example
template_data = EmailTemplateCreate(
    name="Welcome Email",
    code="welcome-email",
    subject="Welcome to {{company_name}}!",
    body_html="<h1>Welcome!</h1><p>Thanks for joining.</p>",
    body_text="Welcome! Thanks for joining.",
    tags=["welcome", "onboarding"]
)
template = client.email_templates.create(template_data)
print(f"Created template: {template.name}")