I have a Thyme calendar installed which controls booking information for a client. Clients book meeting rooms using the calendar and they're inserted into the database as "tentative" bookings until a deposit is received.
My client would like to automate the process of removing bookings that are not confirmed with a deposit so I need to write a small cron job to do it with the following requirements:
- I would anticipate running the job probably once per day. I would simply like it to query the database, select any events which are still tentative 7 days after they were booked, and change their type to "cancelled". I'd also like the job to then send the calendar owner an email telling her the number of events that were cancelled, as well as the corresponding dates and titles of the events that were cancelled.
- Each event has it's own table row with a unique ID for each event, an "etype" field storing the event type, "title" for the event title, and "added" which is the date the booking was added to the database (stored as a unix timestamp) - so all the information to do the job is already in the database.
- I would like the ability to change the 7 day period easily just in case the client's needs change down the track. No problem for me to edit the code manually though, I don't need any fancy front ends or anything like that.
I would anticipate this is a fairly quick and easy job for an experienced PHP/MySQL coder, but I don't have the time to learn right now so I'm throwing it out there for someone a bit smarter than me to have a go.