WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 5 months ago

#27239 new defect (bug)

Registration email not sent (multisite subdirectory)

Reported by: pavelevap Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8.1
Component: Users Keywords:
Focuses: multisite Cc:
PR Number:

Description

I am trying to add new user:

  • wp-admin/user-new.php

When I add new user from site administration, there is no notification email sent to activate account.

  • wp-admin/network/user-new.php

When I add new user from network administration, information email is sent. But then I have to add this user to specific site and there is another notification email sent. Everything works well.

Change History (11)

#1 @jeremyfelt
6 years ago

  • Component changed from Networks and Sites to Users
  • Keywords reporter-feedback added

Thanks for the report, @pavelevap.

I just ran through the scenarios I could think of:

  1. Add new network user (no site) through wp-admin/network/user-new.php, notification email sent.
  2. Add new network (and site) user through wp-admin/network/site-users.php, notification email sent.
  3. Add existing network user to a site through wp-admin/network/site-users.php, no notification email sent.
  4. Add new network (and site) user through wp-admin/user-new.php, activation/notification email sent.
  5. Add existing network user to a site through wp-admin/user-new.php, activation email sent.

Is #3 the issue that you're running into?

We should probably duplicate single site behavior here and have a checkbox to skip sending a confirmation email.

#2 follow-up: @pavelevap
6 years ago

Thank you, but my problem is scenario number 4.

There is activation email:
https://core.trac.wordpress.org/browser/tags/3.8.1/src/wp-admin/user-new.php#L19

And it should be sent probably here:
https://core.trac.wordpress.org/browser/tags/3.8.1/src/wp-includes/ms-functions.php#L873

I tried Email Log plugin and wp_mail() call is logged, but no email never received.

I tried also scenario number 1 and it works well, there are two emails (registration and notification).

#3 in reply to: ↑ 2 @jeremyfelt
6 years ago

Replying to pavelevap:

Thank you, but my problem is scenario number 4.

I tried Email Log plugin and wp_mail() call is logged, but no email never received.

No email is received for scenario 4, but the wp_mail() call occurs? Can you duplicate this behavior without any plugins installed?

#4 @pavelevap
6 years ago

Yes, I deactivated plugin for domain mapping, removed SUNRISE and activated Twenty Fourteen (it is fresh 3.8.1 installation).

https://core.trac.wordpress.org/ticket/27239#comment:3

When I add new user from wp-admin/user-new.php, following mesagge is displayed:

"Invitation email sent to new user. A confirmation link must be clicked before their account is created."

And Email log plugin shows that email was processed - probably hooking into wp_mail():

[Something Sites] Activate test1
Hi, You've been invited to join 'Something' at http://something.cz with the role of Administrator. If you do not want to join this site please ignore this email. This invitation will expire in a few days. Please click the following link to activate your user account: http://something.cz/wp-activate.php?key=5611ee130394a5ec

But no email never received. There is no notification and no activation email.
Scenario number 1 works well for me.

#5 @Ipstenu
6 years ago

Can you check your server's email log to see if a mail is actually being sent?

Are all other emails from your server being sent?

#6 @pavelevap
6 years ago

I will try to ask my webhoster, but I am not sure about that, because it is standard shared program and I have no direct access to server.

Yes, all other emails work well (I tried to insert comment and notification received, also scenario number 1 works well), so I guess it is not related to any server email issue...

#7 @pavelevap
6 years ago

Scenario 1: There are 3 emails:

a) From wordpress@domain to Registered user (Username and password).

b) From wordpress@domain to Administrator (Registration notification contains username, IP and link to cancel notification: wp-admin/network/settings.php).

c) From wordpress@domain to Administrator (Another registration notification contains username and email).

Scenario 4: There is only one email:

a) From Administrator to Registered user (Activation notification).

My problem was related to my hoster restriction ("Sender domain not allowed - only from hosted domains"). And my administration email was set to gmail.com and in scenario 4 it was used for "From" field. I am not sure why? So email was processed, but blocked by ISP. You can probably close this ticket or maybe "From" field should be changed also to wordpress@domain?

#8 @jeremyfelt
6 years ago

  • Keywords reporter-feedback removed

Ok, that makes sense. It looks like this has been in place since the MU merge. The same notification is triggered when registering a new blog as well.

$admin_email = get_site_option( 'admin_email' );
if ( $admin_email == '' )
	$admin_email = 'support@' . $_SERVER['SERVER_NAME'];

This is probably how notifications should happen in multisite. At the network level, the administrator is acting as a global administrator. At the same time, each individual site is then able to have their own mail identity. Ideally, the server is configured to handle both scenarios (mail delivery being a finicky thing).

It may be worth putting some kind of filter in to make it easier to override. It may also be worth rethinking how various bits of registration and notification happen. The filters in wp_mail() can probably help in the near term.

#9 @chriscct7
4 years ago

  • Keywords close added

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


4 years ago

#11 @jeremyfelt
4 years ago

  • Keywords close removed
  • Milestone changed from Awaiting Review to Future Release

This is related to #34293. We should probably keep it open as we determine the best way to clarify where global notifications are sent FROM.

Note: See TracTickets for help on using tickets.