I have a table, that consists of all the info to run a campaign. The info includes, the time interval to check the campaign (10 mins, 15 mins etc.) and other information to check whether it meets the specific requirement or not, to run the campaign.
At the moment, what I am planning to do is:
- Add my code in one php file
- In the code, go through all the rows of the table
- Check if it’s the time to check the campaign or not (via the interval)
- If it’s the time to check the campaign, then go through other details of the table and based on the set conditions, send an email or SMS.
- I am planning to run a cron job which goes through this php file, after every 10 minutes (As it’s the shortest check interval)
I need suggestions, whether it’s the proper solution or not OR if someone has any better and efficient solution?