I added a number of users to a subsite and wanted them all to get email notifications for a blog on the subsite. Here's how I did it:
1) sign up for notifications and look at the HTML source for request-new-2.
2) make a new "subscribe.tcl" page:
ad_page_contract {
}{
}
db_multirow user users_query {
select member_id from group_member_map where group_id = 20878;
} {
set request_result [ notification::request::new \
-type_id 7371 \
-user_id $member_id \
-object_id 21787 \
-interval_id 7289 \
-delivery_method_id 7291]
ns_write "result: $member_id, $request_result\n"
}
The select statement can be anything that returns user_ids; the values in the notification::request::new command can be obtained from the HTML source in step 1.
3) View the page.