I am writing a script for an e-commerce site. It will allow customers to subscribe to changes in one of many categories. Or any combination of categories, so the email that is sent to an individual customer is potentially unique to that customer. It will be run by cron once a week.
It is a busy site and it is possible that there may ultimately be tens of thousands of subscriptions with each one requiring processing and then the sending of an email. So, the question is what is the best way of doing this?
In a single file the process will inevitably time out.
I could run individual cron jobs until the list of subscriptions is completed? Or perhaps redirect the file to itself until the list is complete?
Is there a standard way of doing this? Any advice is gratefully accepted.
And I apologise if this is a duplicate. I have searched but finding the right search terms is tricky.