function nodejs_send_role_message in Node.js integration 7
Same name and namespace in other branches
- 8 nodejs.module \nodejs_send_role_message()
- 6 nodejs.module \nodejs_send_role_message()
Send a message to users in a role.
Parameters
string $role_name:
string $subject:
string $body:
1 string reference to 'nodejs_send_role_message'
- nodejs_drush_command in ./
nodejs.drush.inc - Implements hook_drush_command().
File
- ./
nodejs.module, line 244
Code
function nodejs_send_role_message($role_name, $subject, $body) {
$query = db_select('users', 'u');
$query
->join('users_roles', 'ur', 'ur.uid = u.uid');
$query
->join('role', 'r', 'ur.rid = r.rid');
$uids = $query
->fields('u', array(
'uid',
))
->condition('r.name', $role_name)
->execute()
->fetchCol();
nodejs_send_user_message_multiple($uids, $subject, $body);
}