On Thu, Nov 22, 2018 at 02:59:02PM +0530, Tushar Nadkar wrote:
> i have email id of multiple user , so how can i send mail after 3 days when
> he click a button .or checkout button in django
I record the timestamp of the button click in a model then I run cron
or celery periodically to query the model like this:
ready_to_email = MyModel.objects.filter(when_button_clicked__lte=timezone.now()-timedelta(days=3), already_emailed=False)
Then I use the django mail module to send the emails. Finally I record
that the emails were sent in the model(already_emailed = True) so they
don't get sent again.