Yubin

class maykin_common.yubin.backends.QueuedEmailBackend(*args: Any, **kwargs: Any)

Queue emails without dispatching a celery task.

Copied from django_yubin.backends.QueuedEmailBackend. It replaces the queue_email_message usage with our own variant.

send_messages(email_messages: Iterable[EmailMessage]) int

Add new messages to the email queue, return the number of messages queued.

The email_messages argument should be one or more instances of Django’s core mail EmailMessage class.

maykin_common.yubin.utils.enqueue(message: django_yubin.models.Message, log_message: str | None = None) bool

Marks a message as queued returning True if successful otherwise False

Removes celery from the original Message.enqueue()

maykin_common.yubin.utils.queue_email_message(email_message: EmailMessage, fail_silently: bool = False) int

Add new messages to the email queue.

The email_message argument should be an instance of Django’s core mail EmailMessage class.

The fail_silently argument is not used and is only provided to match the signature of the EmailMessage.send function which it may emulate.

Removes celery from the original django_yubin.queue_email_message()

maykin_common.yubin.utils.retry_messages(max_retries: int = 3) tuple[int, int]

Retries messages that have failed to send and returns a tuple of total tries and failed tries

Removes celery from the original Message.retry_messages()