Hello

My Drupal site has the following user settings enabled:
- Visitors can create accounts but administrator approval is required.
- Require e-mail verification when a visitor creates an account

Now, I wanted to edit the mail that is sent to the admins when a user requests an account.
Am I overlooking something or is this not possible in the default Drupal UI?

The "_user_mail_text" function in user.module told me that I had to look for a variable "user_mail_register_pending_approval_admin_subject" and "user_mail_register_pending_approval_admin_body" but unlike the other e-mail variables, these variables do not have a form available to change them?

I know it's not that hard to create a custom form to edit the variables but I wanted to make sure this functionality is not hidden somewhere else :)

Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dddave’s picture

Perhaps I am misunderstanding you but you can edit the mails at admin/user/settings. Maybe you missed it because the elements are collapsed?

jvandooren’s picture

Yes I know, but the e-mail that I want to edit is not configurable there...
It's the email that is sent to the admin when a user creates an account that is pending...

If I search my whole drupal project for "register_pending_approval_subject" for example, I can see where the form is created to change the e-mail.
But I can't find a form that sets "register_pending_approval_admin_subject" (or body).

dddave’s picture

Sorry, I misread your issue. That is really a headscratcher...

zeta1600’s picture

Same here... Did you figure this out? I certainly don't want to edit the core /modules/user/user.module. I wish I knew how to create a module.

jonne.freebase’s picture

Version: 6.16 » 7.x-dev

As far as I can tell this is still an issue in D7.

jonne.freebase’s picture

This is a patch that seems to work for me for the limited testing I've done.

jonne.freebase’s picture

Status: Active » Needs review

Status: Needs review » Needs work
jonne.freebase’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
edrupal’s picture

It looks like this functionality is also being addressed by patch register_pending_approval_admin-1804926-7.patch in issue Convert register_pending_approval_admin to config/state system.

No idea which is the better approach.

jonne.freebase’s picture

It appears the other patch is for drupal 8 only (it patches a file called user/config/user.mail.yml , which is not in Drupal 7, AFAICT). So if you use drupal 7, use the patch in this thread.

jonne.freebase’s picture

Status: Needs work » Needs review

#6: 809806-Register pending approval admin mails not configurable.patch queued for re-testing.

trying this again, for some reason the testing script can't download the patch, even though it's right here on drupal.org .

Status: Needs review » Needs work
adammalone’s picture

Status: Needs review » Needs work
FileSize
1.44 KB

Let's try this Drupal 7 patch...

The patch in #6 had some extra stuff from variable module (contrib hence not applicable for a core patch) in so likely won't apply to most Drupal installs.

adammalone’s picture

Status: Needs work » Needs review
alexpott’s picture

Status: Needs work » Closed (duplicate)

This is a feature and should be done in Drupal 8 first and then backported. There already is an issue for this - #1804926: Convert register_pending_approval_admin email to config system and provide the ability to configure it in UI. - so marking this as duplicate - yes I know this one was definitely first (1,000,000 nodes earlier!) but that issue already has a D8 patch.