Skip to content

common_reports.emails.core

CoreEmailClient — the engine seams, filled by a provider.

CoreEmailClient fills the abstract _send / _list seams of :class:BaseEmailClient by delegating to an injected :class:BaseProvider, and implements the mailbox operations (search, threads, replies, drafts, labels, history, watch) over the provider’s capability-gated methods. The MIME composer lives in emails/composer.py; build_message / resolve_attachments / ATTACHMENT_TRAILER_HTML stay importable from here for compatibility.

Classes

CoreEmailClient

Bases: BaseEmailClient

Fills the engine seams by delegating transport to a :class:BaseProvider.

The MIME assembly (build_message) lives in the engine; the provider only transmits / reads. Swap the provider (SMTP/Gmail) without touching the pipeline or the wire format.

__init__

def __init__(provider: BaseProvider, context: Optional[EmailContext] = None, login_user: str = '', name: str = 'default')

Fields and properties declared here; inherited members belong to the bases above.

provider

provider = provider

capability_report

def capability_report() -> CapabilityResult

create_draft

def create_draft(request: DraftRequest) -> DraftResult

create_label

def create_label(request: LabelCreateRequest) -> LabelBatch

delete_draft

def delete_draft(draft_id: str) -> MutationResult

delete_label

def delete_label(label_id: str) -> MutationResult

draft_reply

def draft_reply(request: ReplyRequest) -> DraftResult

Save a reply as a draft in the original’s thread; nothing is sent. It is addressed, threaded and titled exactly as :meth:reply would send it.

get_attachment

def get_attachment(message_id: str, attachment_id: str) -> AttachmentResult

get_message

def get_message(message_id: str) -> MessageResult

get_profile

def get_profile() -> ProfileResult

get_thread

def get_thread(thread_id: str) -> ThreadResult

list_history

def list_history(query: HistoryQuery) -> HistoryResult

list_labels

def list_labels() -> LabelBatch

list_message_refs

def list_message_refs(query: MessageQuery) -> MessageRefBatch

list_thread_refs

def list_thread_refs(query: MessageQuery) -> ThreadRefBatch

modify_labels

def modify_labels(update: LabelUpdate) -> MutationResult

reply

def reply(request: ReplyRequest) -> SendResult
def search(query: MessageQuery) -> MessageBatch

send_draft

def send_draft(draft_id: str) -> DraftResult

stop_watch

def stop_watch() -> MutationResult

watch

def watch(request: WatchRequest) -> WatchResult