Reputation: 339
I want to check the stock level every day at a certain time (say 11pm GMT) and email a list of items that are low on stock to the admin. I have managed to get the mailing function working but I am struggling to limit the checks to once a day (right now it sends an email to the admin email every time the page loads)
Your help will be much appreciated!
Upvotes: 2
Views: 640
Reputation: 10163
In case that impossible to run a cron job, you can save last mail time in DB or file and check timeout on page load.
Upvotes: 1
Reputation: 23480
I think that you just need to put your script in a separate file and run once per day with a cron job
You might want to read more about cron jobs in this post How to create cron job using PHP?
Upvotes: 2