How to allow users to dynamically set the scheduled time for email reports within a web framework?

Question

Right now, I am using crontab to send out scheduled emails.

The way I have been doing it is using a web framework like Django, CakePHP, or Laravel, and then using crontab to call the right django or cakephp console commands at the right time.

Then the console commands will do the work of assembling the information together: recipients, body, attachments, and then send out the email.

I have already given the powers to my users in terms of editing the recipients. Now they want the power to edit the times (time of the day) and frequency (weekly, daily, every wednesday, etc) the emails get sent out.

I am not sure how to allow that within the context of a web framework.

Assume that I am using either Python framework like Django and a PHP framework like Laravel.


Show source
| php   | python   | django   | laravel   | scheduled-tasks   2017-01-04 02:01 1 Answers

Answers ( 1 )

  1. 2017-01-04 02:01

    If you're using Django you can use celery instead of crontab to run your scheduled tasks. You can then write views that will allow your users to manage their own schedules. http://www.celeryproject.org/

    You can start your own Celery Task Manager view from imitating Celery's Django admin page Django Celery admin page

◀ Go back