I am developing a system of deadlines and alerts. The user will register a deadline, date and time of the term and define if he wants to receive the alert with 1, 2 or 3 hours in advance.
How can I perform a function that checks and is it time to send the email to the user? I did not want to do a CRON to run every minute and check if it's time to send the email.
There is some way to create an automatic CRON so that it runs only at the time of sending the email to the user.