I have noticed that whenever a new user registers the admin email account is not notified. I thought the notification was sent automatically.
Is there something I have to set, or is it a bug?

I am using 4.4

Comments

Steven’s picture

It's not a bug, it's just not implemented. If you want it, make a patch or file a feature request.

nsk’s picture

I think I could help with this, but where in the codebase should I put the new code?

--
NSK, Admin of Drupal-based site http://www.wikinerds.org

gatezone’s picture

I'm setting up a small site where new member registration need to be processed by the administrator. Obviously they won't know when new members register. Is there any work-around to this yet? Will there be in 4.5? Having an approval process without notification is a tough one.

killes@www.drop.org’s picture

We send mails to the admin if they need to activate the user's account.

--
If you have troubles with a particular contrib project, please consider to file a support request. Thanks.

gatezone’s picture

When you say "we send emails to the admin..." you mean it's done manually, right? The person registering does this if they know the admin's address or someone has the job of looking every x min, hours, days, or months to see if there are any new accounts? Or do you have some code that does this? Would this be a support request or feature request or are they the same thing in this case? What project does the registration fall within? Thanks, GZ

killes@www.drop.org’s picture

No, "we" as in "Drupal". If the account creation setting is set to "everybody can signup but the admin has to confirm" then Drupal will mail the admin after a new user signed up.

--
If you have troubles with a particular contrib project, please consider to file a support request. Thanks.

sgtaw’s picture

Hi,

It would be nice for the administrator to get a notification of the new users with their name and email address.

I have an autoresponder that I want ALL members subscribed to. Having this automated would be awesome.

Thanks

Ed Aw
~*
Fruit Kid Vegetable

aries’s picture

Agreed. Any solutions?

--
Fehér János aka Aries

spiff06’s picture

File: modules/user.module
Location: around line 1003, before the return statement of the if ($account->status) block
Line to add:

user_mail(variable_get('site_mail', ini_get('sendmail_from')), $subject, t("%u (%umail) has registered an account.\n\n%uri", array('%u' => $account->name, '%umail' => $edit['mail'], '%uri' => url("user/$account->uid/edit", NULL, NULL, TRUE))), "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");

UNTESTED
(copied from the "account approval" section just a block below, and adjusted to include new user's mail address)

voipfc’s picture

Which version(s) of Drupal does the above code work with?

The original query was in June 2004.

spiff06’s picture

I have it working with the latest: 4.6.2.
It's only a call to mail() with standard Drupal objects, should scale well with further versions.

fibre’s picture

Does anyone have an updated solution for 4.7 as i cant seem to locate the above mentioned code in the user module.

Thanks

MichaelCole’s picture

Here's my hack. It will crash your server, eat your database, burn down your ISP, and put a hole in the ozone layer. Meanwhile I'll stand by laughing. Don't say I didn't warn you ;-)

Add this code to the user.module You should probably make a backup. And write down somewhere that you made the change.
(add the parts between HACK HACK HACK)

function user_register_submit($form_id, $form_values) {

...

  else {
    if ($admin && !$notify) {
      drupal_set_message(t('Created a new user account. No e-mail has been sent.'));

      return 'admin/user';
    }
    else if ($account->status || $notify) {
      // Create new user account, no administrator approval required.
      $subject = $notify ? _user_mail_text('admin_subject', $variables) : _user_mail_text('welcome_subject', $variables);
      $body = $notify ? _user_mail_text('admin_body', $variables) : _user_mail_text('welcome_body', $variables);

      user_mail($mail, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");

// HACK HACK HACK HACKHACK HACK HACK HACKHACK HACK HACK HACKHACK HACK HACK HACKHACK HACK HACK HACK
// Send a copy of the new user signup email to the administrator.
      user_mail(variable_get('site_mail', ini_get('sendmail_from')), $subject, t("%u has created an account.\n\n%uri", array('%u' => $account->name, '%uri' => url("user/$account->uid/edit", NULL, NULL, TRUE))), "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");
// HACK HACK HACK HACKHACK HACK HACK HACKHACK HACK HACK HACKHACK HACK HACK HACKHACK HACK HACK HACK

      if ($notify) {
        drupal_set_message(t('Password and further instructions have been e-mailed to the new user %user.', array('%user' => theme('placeholder', $name))));
        return 'admin/user';
      }
      else {
        drupal_set_message(t('Your password and further instructions have been sent to your e-mail address.'));
        return '';

Best of luck! There's no need to contact me about this. If it doesn't work, sorry!

goosey’s picture

anyone tested this?

technivant’s picture

Try the User Register Notify module: http://drupal.org/project/user_register_notify

mirananto’s picture

Please update whether notification for admin when a new user registers has been implimented in Drupal core , or still we need to add "User registration notification" module.

joachim’s picture

Yup, it's in core for 6.

mirananto’s picture

Thanks joachim
Can your please exactly say where this needs to be enabled. Since i was not able to find out.

GarenCheckley’s picture

In drupal 6, the administrator will be notified if a new user registers only if the "Visitors can create accounts but administrator approval is required." option is selected in Admin > User Management > User Settings.

The email: "!username has applied for an account.\n\n!edit_uri" will be sent to the admin address as set in Admin > Site Configuration > Site Information.

If you want the admin (or anyone else for that matter) to be notified when a new user registers and the site has a different setting than "Visitors can create accounts but administrator approval is required.", go ahead and look at Actions and Triggers or the User Registration Notification module.