Just adding this snippet of code here. It still needs an admin interface to set the variable. Note, I've not tested this code. Just adding it here based on an IRC support question.
// Send email notification to administrator
if (!empty($user_approval)){
$params = array(
'username' => $username,
'user_approval' => $user_approval,
);
// The User role to email is set by a drupal variable, defaults to the ID 3
$role = variable_get('registration_role_with_approval_role', 3);
// Create an array of admin IDs.
$admin_ids = array(1);
// Find all users with the role of $role.
$result = db_query('SELECT uid FROM {users_roles} WHERE rid = %d', 3);
while ($row = db_fetch_object($result)) {
// add each UID that has a role of "3", the role ID I'm targeting
$admin_ids[] = $row->uid;
}
// check if the current user is an "Admin" role, and return all Admin UID's
$email = implode(', ', $admin_ids);
drupal_mail('registration_role_with_approval', 'registration', $email, language_default(), $params);
}
Comments
Comment #1
toni04 commentedFeature added in attached zip version.
Comment #2
tamerzg commentedThanks just released into 1.2
Comment #3
tamerzg commented