0

This is the use case I am looking for :

  • User will register on my application
  • It is a note making and remainder application
  • While creating remainder users will enter the time my application wants to send user an email at that time
  • I have to use celery for the same I read several posts and stack overflow answers but didn't get proper answer for the same.

My application is written in Django.

1 Answer 1

1

When a user creates a new reminder just schedule a send email task in celery. Note that this is a simple solution but it will make it hard for the user to change notification time after creating it.

From this answer:

To execute a task at a specified date and time you can use eta attribute of apply_async while calling task as mentioned in docs

your_task.apply_async(kwargs={}, eta="your_send_time")

A different solution is to have a task running every 1 minute which will check in DB if there are any emails to be sent. You don't have to use Celery for that. Cron-like lib should do the trick. For example schedule lib or django-cron or Django Commands


Edit: this guy says you should not use dbader/schedule with Django.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks man this worked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.