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 thequeue_email_messageusage 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_messagesargument should be one or more instances of Django’s core mailEmailMessageclass.
- 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_messageargument should be an instance of Django’s core mailEmailMessageclass.The
fail_silentlyargument is not used and is only provided to match the signature of theEmailMessage.sendfunction 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()