Thread
mail_intake.models.thread
Thread domain models for Mail Intake.
Summary
This module defines the canonical, provider-agnostic representation of an email thread as used internally by the Mail Intake ingestion pipeline.
Threads group related messages and serve as the primary unit of reasoning for higher-level correspondence workflows.
Classes
MailIntakeThread
dataclass
Canonical internal representation of an email thread.
Notes
Guarantees:
1 2 3 | |
Attributes
last_activity_at
class-attribute
instance-attribute
Timestamp of the most recent message in the thread.
messages
class-attribute
instance-attribute
Ordered list of messages belonging to this thread.
normalized_subject
instance-attribute
Normalized subject line used to group related messages.
participants
class-attribute
instance-attribute
Set of unique participant email addresses observed in the thread.
Functions
add_message
Add a message to the thread and update derived fields.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message |
MailIntakeMessage
|
Parsed mail message to add to the thread. |
required |
Notes
Responsibilities:
1 2 3 | |