Make WordPress Core

Opened 9 years ago

Last modified 4 years ago

#28530 reopened defect (bug)

WPMU Creating new user does not use welcome notification template

Reported by: jokr's profile jokr Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: dev-feedback needs-patch
Focuses: multisite Cc:

Description

In a multisite setting adding a new user to the network should send a welcome notification to the user with a template defined in Settings > 'Welcome User Email'. But the template is not used.

When creating a new user via /network/user-new.php the method wp_new_user_notification gets called. Instead wpmu_welcome_user_notification should get called.

Attachments (2)

28530.patch (2.3 KB) - added by jokr 9 years ago.
modify wp_new_user_notification so that it redirects to wpmu_welcome_user_notification if multisite is enabled
28530.diff (1.5 KB) - added by UmeshSingla 9 years ago.
Updated new user notification function for multisite

Download all attachments as: .zip

Change History (15)

#1 @jokr
9 years ago

To catch all cases where a notification email is sent and keep it pluggable, it is probably smarter to leave the call to wp_new_user_notification but in there check for multisite and redirect to wpmu_welcome_user_notification if we are in a multisite environment.

#2 @UmeshSingla
9 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Couldn't replicate this, I get a proper email as per template after user activates his account.
Make sure all the plugins are deactivated and you are using one of the default themes.

Version 0, edited 9 years ago by UmeshSingla (next)

#3 follow-up: @jokr
9 years ago

I have verified this with complete clean install of 3.9.1 without plugins and the default Twenty Fourteen theme.

Maybe I am confusing when the template should be applied, because there is many ways to create a new user. I am currently mainly testing the way through the network admin screen as a Super Admin. This way I am getting the following email:

Username: USERNAME
Password: PASSWORD
LOGINLINK

I am expecting:

Dear User,

Your new account is set up.

You can log in with the following information:
Username: USERNAME
Password: PASSWORD
LOGINLINK

Thanks!

--The Team @ SITE_NAME

#4 in reply to: ↑ 3 @UmeshSingla
9 years ago

Replying to jokr:

I have verified this with complete clean install of 3.9.1 without plugins and the default Twenty Fourteen theme.

Maybe I am confusing when the template should be applied, because there is many ways to create a new user. I am currently mainly testing the way through the network admin screen as a Super Admin. This way I am getting the following email:

Username: USERNAME
Password: PASSWORD
LOGINLINK

I am expecting:

Dear User,

Your new account is set up.

You can log in with the following information:
Username: USERNAME
Password: PASSWORD
LOGINLINK

Thanks!

--The Team @ SITE_NAME

The later one appears if user manually registers himself on the site from wp-signup.php

This ticket was mentioned in IRC in #wordpress-dev by MadLems. View the logs.


9 years ago

#6 @MadtownLems
9 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

As a network administrator, I'd completely expect the text input labeled "Welcome User Email " and captioned "The welcome email sent to new users." to be sent to every new user, regardless of if I created them or they signed up on their own.

Is there some reasoning behind NOT sending this to admin-created users?

#7 @UmeshSingla
9 years ago

Well I guess no reason at all, If it is better that way, I'd be happy to patch it up or @Jokr could submit one :)

@jokr
9 years ago

modify wp_new_user_notification so that it redirects to wpmu_welcome_user_notification if multisite is enabled

#8 @jokr
9 years ago

Okay, here we go. As mentioned earlier I see two ways to change this behavior:

  1. the 'add-user' action on network/user-new simply calls wpmu_welcome_user_notification instead of wp_new_user_notification.
  2. wp_new_user_notification checks for multisite and redirects to wpmu_welcome_user_notification if necessary

Both are rather trivial. I chose the second one and tested all ways I know to create a new user. The template is now used in all these cases. The second variant also keeps the function plugable.

#9 @UmeshSingla
9 years ago

I think instead of modifying the wp_new_user_notification, we can just replace it with wpmu_welcome_user_notification in multisite files.

The first one seems to be better, although it needs to be added to multiple files.

Last edited 9 years ago by UmeshSingla (previous) (diff)

@UmeshSingla
9 years ago

Updated new user notification function for multisite

#10 @jokr
9 years ago

Looks good to me. I applied to patch to my testing environment and it all works as intended.

#11 @Ipstenu
9 years ago

To add another reason why we need this, wp_new_user_notification sends the email from the main site, which means the subject will be "[MAIN SITE NAME] Your username and password"

This should be "[NETWORK NAME] ...." instead, to prevent confusion. While it's certainly rarer to create users from the network admin like that, it's definitely not expected behavior.

#12 @UmeshSingla
9 years ago

  • Keywords dev-feedback added

#13 @chriscct7
7 years ago

  • Keywords needs-patch added
Note: See TracTickets for help on using tickets.