Let's say, I have a course which consists of N lessons. I want to offer it via email subscription. Each N days an email with content should be sent to all the users who've subscribed.
I want it to be sent to the users every 1, 2 or 3 days. For instance.
I'm looking into a way to create a database scheme where I'll able to store these time ranges, and of other types (weeks, months...), in the future.
Date-time ranges can be in minutes, hours, days, weeks and months. And there should be a possibility to specify at what time during a day it'll be sent, or which day of week, etc...
Note that each newly subscribed user should also go through the same process: he'll receive the same N lessons with the same frequency or date-time ranges, for instance: 1st lesson on day 1 at 15:00 o'clock UTC, 2nd on day 3 at 9:30 o'clock, 3rd on day 8 at 21:15 o'clock and so on.
This type of scheme isn't the same as the one for scheduling re-occuring tasks and cron in Linux.
And I want it to be flexible enough too.
I've began with these fields:
* frequency_unit: enum (minute, hour, day, week, month) * frequency_value: int
How to create it?