Задать вопрос

Тел: +7 965 3737 888





Email queue in DB

This is what I use to send simple status emails from my sites. Instead of a django.core.mail.send_mail call, which can take an irrritatingly, nondeterministically long time to return (regardless of error state), you can stow the emails in the database and rely on a separate interpreter process send them off (using a per-minute cron job or what have you). You then also have a record of everything you've sent via email from your code without having to configure your outbound SMTP server to store them or anything like that.

Usage notes are in the docstring; share and enjoy.

Вопрос полезен? Да0/Нет0

Ответы (1):

Ответ полезен? Да0/Нет0

Nice script but I think there is already a reusable app for this purpose. Search for django-mailer which handles the same usecase.