When an admin adds user accounts, there should be a checkbox to 'email user account details to new user' so that the new users can see their new login info. Otherwise, it is quite tedious for the for the admin to have to do this.

Comments

m3avrck’s picture

Status: Active » Needs review
StatusFileSize
new2.67 KB

Ok here's a patch which allows this. When creating a new account while logged in as an admin of users, there is a new checkbox option to notify the user of the new account. This *really* helps out a lot, as all of the Drupal sites I create only the admin can create accounts and everyone needs to know their login (30+ people per site).

Chris Johnson’s picture

Patch looks good, and this is a needed feature. Have not installed and tested it yet, but hope to get to that tomorrow.

Souvent22’s picture

Status: Needs review » Reviewed & tested by the community

Patched this against head, and works great. created 3 users, and all 3 got their emails. def. need this patch.

killes@www.drop.org’s picture

This feature is needed, it always annoys me when I have to compose a separate mail to the users after creating their account. I am wondering if we whould have an extra mail text for this case.

DriesK’s picture

I agree with killes. This feature is really needed, but we need a different body text for the email. Now it starts with 'thank you for registering at %site', but the user didn't register himself, and may even not have been aware that an admin was going to register him. I think it should say something like 'An administrator of %site created a new account for you blahblah...'.

m3avrck’s picture

StatusFileSize
new4.76 KB

killes and DriesK, good catch.

Here's a new patch with slightly tweaked email subjects and bodies for accounts created by admins.

m3avrck’s picture

StatusFileSize
new8.04 KB

Updated patch after talking with Matt.

UncleD’s picture

Tested this user.module_21.patch and it worked properly as described. user received email, was able to login through the url that came through the email, all is groovy.

venkat-rk’s picture

Any chance this great feature will also be tagged for the 4.6 branch of user.module?

Tobias Maier’s picture

short answer: no

because we dont add new features to 4.6 only to 4.7 - the current development version

ronsens’s picture

Version: x.y.z » 4.6.5

I've made a very dirty hack for 4.6.5

This adds no notify-option to user admin menu, I just put the part for new user registration into the section where admin creates new account:

After line (1320)

      user_save('', array('name' => $edit['name'], 'pass' => $edit['pass'], 'init' => $edit['mail'], 'mail' => $edit['mail'], 'roles' => $edit['roles'], 'status' => 1));

I've just added

    $variables = array('%username' => $edit['name'], '%site' => variable_get('site_name', 'drupal'), '%password' => $edit['pass'], '%uri' => $base_url, '%uri_brief' => substr($base_url, strlen('http://')), '%mailto' => $account->mail, '%date' => format_date(time()), '%login_uri' => url('user', NULL, NULL, TRUE), '%edit_uri' => url('user/'. $account->uid .'/edit', NULL, NULL, TRUE));
    $subject = _user_mail_text('welcome_subject', $variables);
    $body = _user_mail_text('welcome_body', $variables);
    user_mail($edit['mail'], $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");
    return t('Your password and further instructions have been sent to your e-mail address.');

So every time an admin creates a new account, the welcome message for new users will be sent to the new user. Works for me, but isn't elegant.

m3avrck’s picture

Version: 4.6.5 » x.y.z

This patch still applies to CVS and works great, seems like a very useful feature and I need it on a bunch of sites!

m3avrck’s picture

StatusFileSize
new8.61 KB

Keeping up with HEAD.

samo’s picture

Hey m3avrck,

Thanks for maintaining this patch. It is definitely a major add for many administrators.

This patch works well for me. The only changes I could see making would be text changes on the admin/settings/user page.

"Subject of welcome e-mail (created by administrator)" ==> How about "user created by administrator"?

The subject of the message by default is "Account details for %username at %site (admin created)". How about something like "An administrator created an account for you at %site"?

m3avrck’s picture

StatusFileSize
new8.62 KB

samo great idea! Here's a new patch with updated text.

gerhard killesreiter’s picture

Status: Reviewed & tested by the community » Needs work

doesn't apply anymore.

m3avrck’s picture

Status: Needs work » Needs review
StatusFileSize
new8.29 KB

Updated patch against HEAD.

killes@www.drop.org’s picture

Status: Needs review » Fixed

applied

Anonymous’s picture

Status: Fixed » Closed (fixed)