Our notification model needs to be extensible as new notifications are added and allow for parameters in our notification messages. Different notifications will have different parameters. I propose the following framework.


Contains defined constants for each event

e.g. define('NOTIFICATION_NEW_POST', 100);

And an array decscribing each notification

rgEventDetails = array( 
                            NOTIFICATION_NEW_POST => array( 'name' => 'New Item Posted',
                                                                 'arguments'=> array('Title', 'Author', 'URL'),

The rgNotificationDetails array would be useful both for sending notification messages and for giving authors of the templates a list of parameters they can substitute for.

All Notification Templates would be stored in the event_template table. These are NotificationTemplate objekts. The fields in this table are:

id, idNotification, title, body, idSite, idAuthor, createdOn, lastModified, modifiedby

Subscriptions to notifications will be stored in the notification_sub table which will have an idUser, idSite, and idNotification.

Code will raise a notification with the function call

TriggerNotification( NOTIFICATION_NEW_POST, 
                             'Author'=> $author,
                             'URL' => $url));

It would be nice to have the ability to create specific objects to handle some notifications.

We will have a "control panel" for notifications where all notifications can be seen and new ones created. We should be able to leverage the current browse.php or collection.php files.