You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just stumbled across this project and it seems to do everything I want, including some sort of rate limiting.
Currently I have to live with the fact that I can only send a few thousand emails per day.
Typically, most emails will have to be sent during business hours (different timezones are not an issue for now), and outside of those there wont be much to do, except an occasional password reset.
Using something like django-celery-beat I would setup a few periodic tasks that run every minute (one from midnight to 0600, one from 0600 till 1800 and one from 1800 till midnight) and adjust the admount of emails sent by each task. (e.g. the one from 1800 until midnight can only send one per minute, while another might send 5 per minute.
The three config parameters
MAILER_EMAIL_MAX_BATCH = None # integer or None
MAILER_EMAIL_MAX_DEFERRED = None # integer or None
MAILER_EMAIL_THROTTLE = 0 # passed to time.sleep()
seem quite helpful, but it would be great if I could pass a number of emails that should be sent to one of the management commands.
The text was updated successfully, but these errors were encountered:
This seems to work without any issues, although I am not a 100% sure if it's a clean way of doing this.
Regarding the three config parameters for rate limiting, after closer inspection, I think I have an idea on how to achieve "dynamic" rate limiting based on time of day. Consider the following:
I just stumbled across this project and it seems to do everything I want, including some sort of rate limiting.
Currently I have to live with the fact that I can only send a few thousand emails per day.
Typically, most emails will have to be sent during business hours (different timezones are not an issue for now), and outside of those there wont be much to do, except an occasional password reset.
Using something like
django-celery-beat
I would setup a few periodic tasks that run every minute (one from midnight to 0600, one from 0600 till 1800 and one from 1800 till midnight) and adjust the admount of emails sent by each task. (e.g. the one from 1800 until midnight can only send one per minute, while another might send 5 per minute.The three config parameters
seem quite helpful, but it would be great if I could pass a number of emails that should be sent to one of the management commands.
The text was updated successfully, but these errors were encountered: