notification::new (public)

 notification::new [ -notification_id notification_id ] \
    -type_id type_id -object_id object_id [ -response_id response_id ] \
    [ -notif_subject notif_subject ] [ -notif_text notif_text ] \
    [ -notif_html notif_html ] [ -subset subset ] \
    [ -already_notified already_notified ] [ -action_id action_id ] \
    [ -force ] [ -default_request_data default_request_data ] \
    [ -return_notified ] [ -notif_user notif_user ] \
    [ -notif_date notif_date ] [ -file_ids file_ids ]

Defined in packages/notifications/tcl/notification-procs.tcl

Create a new notification if any notification requests exist for the object and type.

The normal function is to send one notification per notification_request that match this notification. However, by supplying one or more of the parameters below, it's possible to notify only a subset of those people who have requested notification.

This is useful in two situations. One is when you have multiple notification types that cover the same event, for example notification for an entire forum, and for a single thread within that forum. In this situation, you typically want people to receive only one notification per event (per delivery method and interval). The 'already_notified' and 'return_notified' switches help you do this.

Another situation is when your relevant audience really depends on something dynamic in your application, such as who's assigned to a certain action in a workflow, or if you want to offer a 'notify me of all activity in all forum threads that I've posted to'. In this case, the notification type would be 'my_threads' or similar. But when you notify, you only want to notify the users who've requested this notification, and who have posted to this thread. Thus, you'll need to pass in a list of user_id's of the users who posted to the current thread in the 'subset' parameter, and only those who have both a request and are in the subset list will get notified.

A variation on this is when you want people to get notified, even if they didn't request notification. This is what the -force flag does, it causes all users in the subset to get notified, whether or not they have a notification request.

In this case, the request will use the interval, delivery method, and format as specified in the 'default_request_data' parameter. If such a parameter is not specified, default values of 'instant', 'email', and 'text' will be used. The value to 'default_request_data' should be an array list with entries interval_id, delivery_method_id, and format.

In any situation where you're doing dynamic notifications, you must supply the ID of an ACS object which is specific to the underlying event in the 'action_id' parameter. This is required for the integral functioning of dynamic recipient groups. Typically this would be the ID of a forums posting, a workflow log entry, or a web log entry.

Switches:
-notification_id (optional)
-type_id (required)
-object_id (required)
-response_id (optional)
-notif_subject (optional)
-notif_text (optional)
-notif_html (optional)
-subset (optional)
A list of user_id's of a subset of users who should be notified. Only those who have a notification request for this object, and who are in the subset list will get notified. Unless you specify the -force flag, in which case everybody in the subset list will get notified, whether they requested the notification or not. In this case, the 'default_request_data' will be used for these new requests.
-already_notified (optional)
A list of 'user_id interval_id delivery_method_id' of users already notified of this action. This is used in conjunction with the 'return_notification' boolean flag, which causes this proc to return a similar list of users notified by this call. This is used to ensure that a user is never notified twice in the same way for the same action, which could otherwise happen if you have, for example, notification requests for both an entire forum and a particular thread.
-action_id (optional)
If you're supplying either the 'subset' or the 'already_notified' parameter, you must also supply the action_id parameter. The action_id parameter should be the object ID of an ACS Object, and should be specific to the underlying event.
-force (optional, boolean)
See the 'subset' parameter.
-default_request_data (optional)
An array list with entries interval_id, delivery_method_id, and format, used to initialize new requests caused by the combination of the 'subset' and the 'force' parameters.
-return_notified (optional, boolean)
-notif_user (optional)
-notif_date (optional)
-file_ids (optional)
Authors:
Ben Adida
Lars Pind

Partial Call Graph (max 5 caller/called nodes):
%3 calendar::do_notifications calendar::do_notifications (public) notification::new notification::new calendar::do_notifications->notification::new faq::notification_delivery::do_notification faq::notification_delivery::do_notification (private) faq::notification_delivery::do_notification->notification::new forum::message::notify_moderators forum::message::notify_moderators (private) forum::message::notify_moderators->notification::new forum::message::notify_users forum::message::notify_users (private) forum::message::notify_users->notification::new fs::do_notifications fs::do_notifications (public) fs::do_notifications->notification::new ad_conn ad_conn (public) notification::new->ad_conn ad_string_truncate ad_string_truncate (public) notification::new->ad_string_truncate db_dml db_dml (public) notification::new->db_dml db_foreach db_foreach (public) notification::new->db_foreach db_list_of_lists db_list_of_lists (public) notification::new->db_list_of_lists

Testcases:
No testcase defined.
[ show source ]
Show another procedure: