It would depend on how accurate '24' hours needs to be, but something like the following approach should work.
Create a table to hold user registrations, or adapt an existing table to hold a registrationTime
column. Make this column nullable DATETIME
you will use it to hold the HH:MM
of the users registration. The new (or modified) table should also have the data relevant for the emails, or a common identifier for users, allowing the correct data to be selected.
Finally, you would set up a cron job to query the data base every x mins
and select the users who registered within y mins
of 24hours. Where x
is how often you want the job to run and y
would be some degree of tolerance for how close to 24:00 hours had elapsed.
For any results you would construct and send the emails. Finally you would set some a flag to show that user had been dealt with - a good way would be setting the registrationTime
to null for all users who have had the email sent.
Here are a few links to help you out:
Compare time in SQL Server
How can I compare time in SQL Server?
Introducing Cron
http://www.sitepoint.com/introducing-cron/