New user registration does not notify admin

voipfc - June 5, 2004 - 12:01

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

Feature

Steven - June 5, 2004 - 18:02

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

where in the source

nsk - June 3, 2005 - 11:05

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

New member notification

gatezone - September 20, 2004 - 22:11

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.

We send mails to the admin if

killes@www.drop.org - September 20, 2004 - 23:48

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.

When you say "we send emails

gatezone - September 22, 2004 - 16:27

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

No, "we" as in "Drupal". If t

killes@www.drop.org - September 22, 2004 - 18:35

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.

For Autoresponder....

sgtaw - February 6, 2005 - 15:39

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

Agreed

aries - June 2, 2005 - 13:48

Agreed. Any solutions?

--
Fehér János aka Aries

Admin notification of new user registration

spiff06 - June 30, 2005 - 20:15

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)

Which version(s) of Drupal

voipfc - July 7, 2005 - 15:40

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

The original query was in June 2004.

4.6.2

spiff06 - July 28, 2005 - 22:53

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.

Solution for 4.7

fibre - September 27, 2006 - 03:44

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

Thanks

Here is my hack for 4.7.3

MichaelCole - November 10, 2006 - 00:20

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!

anyone tested this?

goosey - November 23, 2006 - 07:31

anyone tested this?

Try the User Register Notify

technivant - October 17, 2007 - 10:07

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

Is this functionality added in Drupal 6.X

mirananto - May 23, 2009 - 13:36

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.

Yup, it's in core for 6.

joachim - June 3, 2009 - 14:01

Yup, it's in core for 6.

Show some light on this

mirananto - June 5, 2009 - 05:44

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

 
 

Drupal is a registered trademark of Dries Buytaert.