1

I am trying to schedule emails to send based on the date and time user will provide. I looked into celery beat but I didn't find any thing that can help with dynamic time.

I also looked into this post: Gmail Schedule Send Email in Django

Can anyone please guide me on how can I send schedule emails based on the time user will provide to the system instead of checking into the system again and again like every five minutes or so to send email.

Maisum
  • 29
  • 3
  • That would be pretty hard for you to achieve. Somehow “the system“ has to be notified. And therefore celery in combination with celery beat would indeed fit. – mika Jan 04 '23 at 17:49
  • I want something efficient but it seems this would be dirty. I can go with adding PeriodicTask or Crontab into the database and once that's get executed, I can disable that specific task so it won't be able to run again. Something like that @mika – Maisum Jan 04 '23 at 17:55
  • 1
    My thought was about the following workflow; Query inside the periodic task for all sendable emails, if there are no just return, else start a task to handle the your custom email sending. I think this won’t result in an inefficient result (especially when you‘re using the correct celery setup)& it is a common usecase, from what I‘ve read and saw, but if someone has another soloution which you may find more efficient, go for it I‘d be existed. – mika Jan 04 '23 at 18:21

0 Answers0