I have a system in PHP that works like a booking system. Once a booking is confirmed there are a total of 7 emails/sms that needs to be send. The times of when they need to be send are already known.
For example, 24h before the bookingdate, a email goes out.
Right now we have a cron checking if it is 24h< and the 24h email didnt go out yet, it shoots a job into the queue and the job tries to send the email, if it fails it retries etc..
How am I supposed to get a better grip on my notifications and be able to turn a single notification off or edit the content of the notification for that single booking? I am using a job-worker system that sends the notifications, I can only send them in the queue, when they are ready to be sent.
I was thinking of creating a db table called
planned_notifications with all the content in it, a reference to the booking_id, and a send_after column
I can then remove a row in this table if I dont want the notification to be sent, or I can edit the content in this table to change the content of the notification
A cron is in place to take rows from the
planned_notification table into the queue system.
I am probably not the first with this problem and am looking to get some info on 'best practices' for this type of problem