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 = providercapability_report
def capability_report() -> CapabilityResultcreate_draft
def create_draft(request: DraftRequest) -> DraftResultcreate_label
def create_label(request: LabelCreateRequest) -> LabelBatchdelete_draft
def delete_draft(draft_id: str) -> MutationResultdelete_label
def delete_label(label_id: str) -> MutationResultdraft_reply
def draft_reply(request: ReplyRequest) -> DraftResultSave 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) -> AttachmentResultget_message
def get_message(message_id: str) -> MessageResultget_profile
def get_profile() -> ProfileResultget_thread
def get_thread(thread_id: str) -> ThreadResultlist_history
def list_history(query: HistoryQuery) -> HistoryResultlist_labels
def list_labels() -> LabelBatchlist_message_refs
def list_message_refs(query: MessageQuery) -> MessageRefBatchlist_thread_refs
def list_thread_refs(query: MessageQuery) -> ThreadRefBatchmodify_labels
def modify_labels(update: LabelUpdate) -> MutationResultreply
def reply(request: ReplyRequest) -> SendResultsearch
def search(query: MessageQuery) -> MessageBatchsend_draft
def send_draft(draft_id: str) -> DraftResultstop_watch
def stop_watch() -> MutationResultwatch
def watch(request: WatchRequest) -> WatchResult