This topic is locked

how to delete old notifications (API feature)?

5/3/2025 8:32:57 PM
PHPRunner General questions
W
wfcentral author

I am using the notifications API and finding it useful. However, there is one thing I need to figure out (or maybe I'm not reading the manual correctly).

$expire
optional expiration date and time for the message. Can be either datetime in "YYYY-MM-DD hh:mm:ss" format, or a number of minutes the notification should be visible.

To me that means that whether a person reads the notification or not... if you set the expiration for a date or an hour later... it seems that the system will delete the notification even if they have not yet read it.

So, if I'm reading that wrong and it means if the expiration date/time has been met AND the user has read the message THEN it gets deleted that is fine.

If not, I need to figure out how to use a cron job to delete old read messages because the notification dropdown is littered with old read messages.