I feel the default for User module should be to always 'Notify user of new account' when admin creates a new user. This way admin must choose NOT to send the notice when creating the new user. This matches the non-admin behavior of user registration and prevents the oversight of the send notice option and the one use login not being available to the new user.

xjm disagrees (#17).

Comments

devin carlson’s picture

Status: Active » Needs review
StatusFileSize
new425 bytes

I agree, having the checkbox checked by default would be a nice little usability improvement. I can't think of many situations in which you would want to create more users without notifying them than users with notifying them.

The attached patch changed the checkbox to checked by default.

Status: Needs review » Needs work

The last submitted patch, 691294-notify-user-of-new-account-by-default.patch, failed testing.

PawelR’s picture

Status: Needs work » Needs review
StatusFileSize
new582 bytes

Attached patch working with AccountFormController.

Status: Needs review » Needs work

The last submitted patch, notify-user-of-new-account-by-default_691294-2.patch, failed testing.

PawelR’s picture

Status: Needs work » Needs review
StatusFileSize
new611 bytes

I was surprised that following tests failed:

OpenIDRegistrationTest
UserAdminTest
UserRegistrationTest
UserRolesAssignmentTest

I would expect that this patch could affect only UserCreateTest.
I've found that user (self) registration logic is based on default value of this checkbox which IMHO should only be used only when administrator creates an account.

class RegisterFormController extends AccountFormController {
...
public function save(array $form, array &$form_state) {
...
$notify = !empty($form_state['values']['notify']);
....
$op = $notify ? 'register_admin_created' : 'register_no_approval_required';

I created new patch with walk around but maybe it would be worth to consider a change in registration workflow logic which would not rely on default value of this checkbox.

Status: Needs review » Needs work

The last submitted patch, notify-user-of-new-account-by-default_691294-5.patch, failed testing.

PawelR’s picture

Status: Needs work » Needs review
StatusFileSize
new1.41 KB

missed one test

noels’s picture

Status: Needs review » Reviewed & tested by the community

All user and OAuth tests pass.

catch’s picture

Status: Reviewed & tested by the community » Needs work
+      '#default_value' => $register && $admin ? TRUE : NULL,

What not just $register && $admin? FALSE should be fine there.

PawelR’s picture

Status: Needs work » Needs review
StatusFileSize
new1.41 KB

Status: Needs review » Needs work

The last submitted patch, notify-user-of-new-account-by-default_691294-10.patch, failed testing.

PawelR’s picture

Status: Needs review » Reviewed & tested by the community

I tried suggestion in #9 but test failed because of that change. It's invalid valid PHP syntax.
I'm sorry, I misread #9.

PawelR’s picture

PawelR’s picture

Status: Needs work » Needs review
StatusFileSize
new1.4 KB
dudycz’s picture

Straightforward change, looks better now without TRUE : NULL.

xjm’s picture

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Hmm, a few things:

  1. I actually disagree with this change. I almost never want to send emails to users. In general, sending email by default is a bad idea. Let's get more feedback on this change.
  2. The change we're making in testCreateUserWithRole() seems a bit simplistic to me. Instead of changing the test to assert a message for a different setting than what the test is testing, let's instead set the configuration we want explicitly in the test.
dudycz’s picture

I think that change is nice usability improvement.
In general I also think sending emails to users is a bad idea but not in this case.
Here we are talking about creating their accounts, this email contains information how to use it.
It's a very good idea to send an email in this particular case.

xjm’s picture

Here we are talking about creating their accounts, this email contains information how to use it.
It's a very good idea to send an email in this particular case.

It's sometimes a good idea to do so, but IMO it's never a good idea when the site owner didn't intentionally configure it to do so.

jsgammato’s picture

I'd love to see a switch to make it admin-configurable. Clearly many people want it, but others do not. It would be great if each of us could select for ourselves the default value for our sites.
I want it. It's frustrating to forget to check it and finish creating a user only to have missed the chance to notify the user automatically.

jsgammato’s picture

Issue summary: View changes

Updated issue summary.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dpi’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)
devert’s picture

Though this issue is closed, I would still like this functionality on a project. Updating the patch to work correctly with latest 8.2.x dev branch.

devert’s picture

Re-roll of patch to make a tweak to the assertText test in UserRolesAssignmentTest.php

webel’s picture

+1 definitely would like default for notification on creation of account by admin to be configurable (so can be set to true so not forgotten). Shame this module only D7: https://www.drupal.org/project/new_account_helper

mlncn’s picture

Title: Change Notify user of new account default » Users should be notified of account creation by default OR administrators should have an easy way to send the registration e-mail after account creation
Version: 8.2.x-dev » main
Status: Closed (won't fix) » Active

This was closed as "won't fix" 13 years ago, but those who argued for that had not even shared enough of their thought process to explain, for instance, what their typical approach for getting passwords to people is, if not to have people receive an e-mail where they can set the password themselves. (Tell them to use the forgot password link? Not a welcoming new user experience!)

So i will tentatively re-open this.

I am very sympathetic to the "never send an e-mail without explicit intent" position but the problem is that currently if you fail to check "Notify user of new account" (which really must be the 95% use case?) there is no recovery.

So an alternative to changing the default might be to add functionality to send (and re-send?) the registration e-mail, at least for any accounts where the Last access is "never'. Then the link to send this e-mail could be shown when /admin/people/create is submitted without notifying the user of the new account. A simple "Notify user of new account" offer immediately after adding a user. The capability could be made available on the admin/people page, only for those who have not yet accessed the site.

Another option:

Two form submit buttons, one primary button which says "Create new account and send notification to user" and another button which says "Create new account without notifying user"

In all these cases the ability to preview the notification would be a great addition, but that is out of scope. (And the ability to personalize the new account notification is definitely out of scope.)

Also, the contrib solution for modern Drupal to simply enable the toggle by default:

Notify User Default, https://www.drupal.org/project/notify_user_default