Skip to content

notifications.dto

dto

Deprecated compatibility imports for :mod:codex_platform.messaging.dto.

Classes

ThreadHeadersDTO

Bases: BaseDTO

RFC 5322 threading headers attached to outbound email notifications.

Source code in src/codex_platform/messaging/dto.py
class ThreadHeadersDTO(BaseDTO):
    """RFC 5322 threading headers attached to outbound email notifications."""

    message_id: str
    in_reply_to: str | None = None
    references: list[str] = []
    thread_key: str
    reply_match_token: str | None = None

NotificationRecipient

Bases: BaseDTO

Recipient info. PII fields auto-masked in repr via BaseDTO.

Source code in src/codex_platform/messaging/dto.py
class NotificationRecipient(BaseDTO):
    """Recipient info. PII fields auto-masked in ``repr`` via BaseDTO."""

    email: str | None = None
    phone: str | None = None

NotificationPayloadDTO

Bases: BaseDTO

Base notification payload: identification and routing only.

Source code in src/codex_platform/messaging/dto.py
class NotificationPayloadDTO(BaseDTO):
    """Base notification payload: identification and routing only."""

    schema_version: int = PAYLOAD_SCHEMA_VERSION
    notification_id: str
    recipient: NotificationRecipient
    channels: list[NotificationChannel] = [NotificationChannel.EMAIL]
    event_type: str | None = None
    subject: str | None = None
    headers: ThreadHeadersDTO | None = None

TemplateNotificationDTO

Bases: NotificationPayloadDTO

Mode 1: worker fetches context from Redis and renders the template.

Source code in src/codex_platform/messaging/dto.py
class TemplateNotificationDTO(NotificationPayloadDTO):
    """Mode 1: worker fetches context from Redis and renders the template."""

    template_name: str
    context_key: str

RenderedNotificationDTO

Bases: NotificationPayloadDTO

Mode 2: pre-rendered HTML passed directly to the worker.

Source code in src/codex_platform/messaging/dto.py
class RenderedNotificationDTO(NotificationPayloadDTO):
    """Mode 2: pre-rendered HTML passed directly to the worker."""

    html_content: str
    text_content: str | None = None