Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Stan Turyn on
When a site admin creates new user an e-mail gets sent with a one-time login link. However if a site admin forgets to tick the "Notify user of new account" box (which is not checked by default) the new account is as good as dead since the new user will never know about it.
How can we get this box to be checked by default?
Comments
I'd like to know too
A client of mine specifically requested this, so I'd like to know too!
Subscribing
Subscribing
any function?
any function?
Me Too Please!
Would love this functionality.
same here
same here
Check all of your core module
Check all of your core module files for user (probably user.module) and and search for the t string. I think it's something like "Notify user of..." Once you find the string it will have the checkbox and then the default_value will be false. So now you know what you have to override and the name.
Just add it to template in your theme and change the default_value to true.
This worked
Just had to do this. Create your own module, and in the .module file place
Replace MYMODULE with the name of your module, and don't include the closing php tag. Enable it and you should be set!
(this for Drupal 7, BTW)
Would Someone Post a Module?
Would someone consider simply making this a module for 7.x / 8.x that can be added to any install?
The only glitch I hit is creating the module info file. Can't be as troublesome as I'm finding it. Or can it be basically blank?
Try this
Try https://github.com/vegardjo/newacc (haven't tested it, but should work)
Downloading to test.
Downloading to test.
Ended up now getting lots of
Ended up now getting lots of errors when I run the update script.
I installed the module manually (FTP'd to the sites folder) and it appears in the module list, but the moment I ran update it gives this:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'ProfileCrudTestCase-class' for key 'PRIMARY': INSERT INTO {registry} (name, type, filename, module, weight) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4), (:db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9), (:db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14), (:db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17, :db_insert_placeholder_18, :db_insert_placeholder_19), (:db_insert_placeholder_20, :db_insert_placeholder_21, :db_insert_placeholder_22, :db_insert_placeholder_23, :db_insert_placeholder_24), (:db_insert_placeholder_25, :db_insert_placeholder_26, :db_insert_placeholder_27, :db_insert_placeholder_28, :db_insert_placeholder_29), (:db_insert_placeholder_30, :db_insert_placeholder_31, :db_insert_placeholder_32, :db_insert_placeholder_33, :db_insert_placeholder_34), (:db_insert_placeholder_35, :db_insert_placeholder_36, :db_insert_placeholder_37, :db_insert_placeholder_38, :db_insert_placeholder_39), (:db_insert_placeholder_40, :db_insert_placeholder_41, :db_insert_placeholder_42, :db_insert_placeholder_43.......
Okay, the error was caused by
Okay, the error was caused by Profile 2. I upgraded to Profile 2 dev release and the issue went away.
I did take the liberty of changing the module to "Notify New" (notifynew), but otherwise left things as they were.
Wonderful fix!!!
Conflict
This works as intended, but causes some sort of conflict when you have user registration setup so that visitors can register, but they need approval by the admin. When enabling this module, a visitor that registers will receive the mail that his account has been created by the admin (instead of a mail saying it's waiting for approval). The admin gets no mail, but the user can't log in because the account hasn't been activated yet.
Looking at the code (I'm not a PHP guy), I'm guessing the checkbox is also checked when a visitor registers (even though this checkbox is then invisible).
D6?
Think this will work in D6? IS this really the simplest solution?
Think so
The hook_form_alter funcition hasn't changed from 6 to 7, so I believe this will work just fine in 6 too. There is no easier way to do this AFAIK.
D6 - can't get it to work
Hi,
I'm using D6 and the check box is NOT selected after installing the module.
Here's my code (I did not put the ?> in my module):
Any thoughts??
Tom Hale
New Day Web Design
www.newdaywebdesign.com
how are we doing with this
how are we doing with this module any progress
This module can very well
This module can very well enable the notification by default.
in genpass.module, function genpass_form_alter(), line 138:
JV
Where abouts do i putt this code
In the file genpass.module line 138 is blank do a copy all this
Getting thomlynn D6 code to work
On D6 it should be
:)
"Notify user of new account" checkbox to be selected as default
Would someone consider simply making this a module for 7.x / 8.x that can be added to any install?
Here's the modules for D6 and D7
I have not written any modules for D8.
http://www.newdaywebdesign.com/blog/notify-user-new-account
Tom Hale
New Day Web Design
www.newdaywebdesign.com
This version is not compatible with Drupal 7.x
Dear Tom,
Thanks a lot for that!
Unfortunately after downloading and trying to activate the module, I get the following error:
"This version is not compatible with Drupal 7.x and should be replaced."
Any ideas why?
BR,
Maria
New module in contrib
I needed this myself so I created a new module now in contrib:
https://www.drupal.org/project/new_account_helper
The default value for Notify User of New Account can be defined in the standard Account Settings admin panel (Default Settings tab), and the value will only apply to users who have the Administer Users permission.
Enjoy !
+1 definitely would like
+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 your nice little module only D7: https://www.drupal.org/project/new_account_helper
D8?
Webel IT Australia, "Elements of the Web", Scientific IT Consultancy,
For PHP-driven Drupal CMS web sites, Enterprise Java, graphical UML, UML Parsing Analysis, SysML, XML.
thanks its worked for me
thanks vegardjo , its worked for me
Creates a problem in (at least)D8
Don't know if this is true for D7 also, but the first suggested simple solution of adding
causes problems for me. Specifically if users sign themselves up for an account, they get the 'new account notification email'. Not the 'waiting for approval' mail. This is counterintuitive if 'user, with admin approval' can make accounts.
Code for D8:
Code for D8:
Nice, you wouldn't have a
Nice, you wouldn't have a module for a non developer?
Thanks in advance
http://gerardroos.nl
d8/d9 Module to set Notify by default in the admin interface.
https://www.drupal.org/project/notify_user_default