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);
  }
CommentFileSizeAuthor
#1 registration_role_with_approval.zip9.49 KBtoni04

Comments

toni04’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new9.49 KB

Feature added in attached zip version.

tamerzg’s picture

Thanks just released into 1.2

tamerzg’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.