function _advuser_mail_roles in Advanced User 6.2
Same name and namespace in other branches
- 5.2 advuser.module \_advuser_mail_roles()
@private Mail users in requested notification role.
Parameters
string $user_subject:
string $user_body:
string $from:
2 calls to _advuser_mail_roles()
- advuser_user_insert in ./
advuser.module - Handle user insertion (new users)
- advuser_user_update in ./
advuser.module - Notify administrator of user profile edit.
File
- ./
advuser.module, line 642 - Advanced user module allows you to select users based on an advanced set of filtering and apply actions to block, unblock, delete or email the selected users.
Code
function _advuser_mail_roles($user_subject, $user_body, $from) {
static $accounts = array();
if (empty($mail_list)) {
$result = _advuser_dbquery_users_to_notify();
while ($row = db_fetch_object($result)) {
$accounts[] = $row;
}
}
foreach ($accounts as $account) {
drupal_mail('advuser', 'advanced-user-mail', $account->mail, user_preferred_language($account), array(
'subject' => $user_subject,
'body' => $user_body,
), $from, TRUE);
}
}