core.mail_processor.core

Module Contents

Classes

MailQueueProcessor

Attributes

log

MAX_SEND_TIME

core.mail_processor.core.log[source]
core.mail_processor.core.MAX_SEND_TIME[source]
class core.mail_processor.core.MailQueueProcessor(*paths: str, limit: int | None = None)[source]
split(filename: str) tuple[str, str, str][source]

Returns the path, the name and the suffix of the given path.

message_files() tuple[str, Ellipsis][source]

Returns a tuple of full paths that need processing.

The file names in the directory usually look like this:

  • 0.1571822840.745629

  • 1.1571822743.595377

The part before the first dot is the batch number the rest is the timestamp at time of calling app.send_sms.

The messages are sorted by suffix, so by default the sorting happens from oldest to newest message.

abstract send(filename: str, payload: str) bool[source]

Sends the mail and returns success as bool

parse(filename: str) str[source]
send_messages() None[source]
send_message(filename: str) bool[source]