I want use queue for send my emails. For this I use the django-mailer with follow config
EMAIL_BACKEND = 'mailer.backend.DbBackend'
MAILER_EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend' #for test
EMAIL_FILE_PATH = os.path.join(BASE_DIR, '..', 'app-messages')
MAILER_EMAIL_MAX_BATCH = 1
MAILER_EMAIL_MAX_DEFERRED = 1
MAILER_EMAIL_THROTTLE = 1000
But when I try to send 5 emails It hasn't fall in queue and sending at once. The my synthetic example
def send_email() :
send_mail(
'subject',
'text_template',
settings.SEND_EMAIL_FROM,
['email@host.com'],
priority=PRIORITY_DEFERRED
)
send_email(instance.id)
send_email(instance.id)
send_email(instance.id)
send_email(instance.id)
send_email(instance.id)
What am I doing wrong? Why the queue is empty and all emails was sent together?