Using cronjobs to notify about due tickets
Many Supabase users may not be aware that Supabase supports the use of cronjobs through a dedicated database extension. This powerful feature allows you to automate and schedule various tasks within your Supabase environment. In this section, we’ll demonstrate how to set up a “ticket due” notification system using cronjobs. This system will automatically send notifications when tickets are due, ensuring timely reminders without manual intervention.
Note
If you haven’t read the Understanding Edge Functions section yet, please do, as we will use Edge Functions in this section. Also, we need the CREATE TABLE testtable
statement from the same section as we will use that table for testing purposes in this section too.
We will implement something very simple to clarify the usage of cronjobs. When a ticket’s state is still open after four weeks of existence, we will make an entry in testtable
that says...