A little plugin into the Subscriptions framework.
Developers (or anyone via a variable_set, and soon administrators through the UI) can use this module to do either or both of these things when a post is published:
- Subscribe users who are referenced in a userreference field.
- Subscribe all authors of nodes belonging to a referenced taxonomy term.
The term reference part can automatically subcribe users to updates on a node if they have authored content in a taxonomy term that is referenced via a taxonomy term reference field.
The user reference part can automatically subscribe users who are in a References module user reference field.
Currently, what field instance this applies to needs to be set as a variable holding an array with one or more arrays with the keys entity type, bundle, and field name. Soon, which field instances trigger this will be configurable by the administrator in the user interface courtesy a separate UI module.
To configure in code, an update hook such as the following will work:
<?php
function hook_update_7001() {
variable_set('subscriptions_referencedusers_term', array(array('entity_type' => 'node', 'bundle' => 'case_presentation', 'field_name' => 'field_expertgroup')));