WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 8 weeks ago

#42135 reviewing enhancement

Add filter to disable email sent by wp-admin/network/site-new.php

Reported by: johnbillion Owned by: johnbillion
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: good-first-bug has-patch dev-feedback
Focuses: multisite Cc:
PR Number:

Description

Related: #42134

wp-admin/network/site-new.php contains a call to wp_mail() which sends an email when a new site is created from Network Admin -> Sites -> Add New on Multisite. (Ref).

It's not possible to disable the email via a filter. One should be implemented similarly to the send_password_change_email filter. (Ref).

Attachments (5)

42135.patch (1.7 KB) - added by kartikparmar 2 years ago.
Added a Filter to disable sending emails on creating a new site on WordPress Multisite.
42135v1.patch (1.9 KB) - added by kartikparmar 2 years ago.
Comment added for the filter.
42135.2.patch (3.1 KB) - added by cmachu 17 months ago.
Add new function with hook - wpmu_new_site_notification - unify usability with wpmu_welcome_notification
42135.3.patch (4.2 KB) - added by dharmin16 15 months ago.
added the feature simmilar to wp_welcome_message(). E.g. Filter 'wpmu_admin_notification' to disable or bypass. Filter 'update_admin_notification' and 'update_admin_notification_subject'} to modify the content and subject line of the notification email.
42135.4.diff (4.0 KB) - added by audrasjb 3 months ago.
Refresh the patch and clean up some code

Download all attachments as: .zip

Change History (17)

@kartikparmar
2 years ago

Added a Filter to disable sending emails on creating a new site on WordPress Multisite.

#1 @kartikparmar
2 years ago

  • Keywords has-patch added; needs-patch removed

@kartikparmar
2 years ago

Comment added for the filter.

#2 @johnbillion
2 years ago

  • Owner set to johnbillion
  • Status changed from new to reviewing

#3 @johnbillion
2 years ago

  • Milestone changed from Future Release to 5.0

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


2 years ago

#5 in reply to: ↑ description @thomaswm
23 months ago

Replying to johnbillion:

It's not possible to disable the email via a filter. One should be implemented similarly to the send_password_change_email filter. (Ref).

Instead of adding a filter for disabling these emails, we could put the code that is responsible for sending the email into a new function and call that function using a hook. This has been done in #33587 for comment notifications and also for signup notification emails in multisite.

@cmachu
17 months ago

Add new function with hook - wpmu_new_site_notification - unify usability with wpmu_welcome_notification

@dharmin16
15 months ago

added the feature simmilar to wp_welcome_message(). E.g. Filter 'wpmu_admin_notification' to disable or bypass. Filter 'update_admin_notification' and 'update_admin_notification_subject'} to modify the content and subject line of the notification email.

#6 @johnbillion
13 months ago

  • Milestone changed from 5.0 to 5.1

#7 @pento
10 months ago

  • Milestone changed from 5.1 to 5.2

#8 @desrosj
8 months ago

  • Milestone changed from 5.2 to 5.3

This ticket has not received any attention during the 5.2 cycle. With beta
1 tomorrow, going to punt this to 5.3.

This ticket was mentioned in Slack in #core by sergey. View the logs.


3 months ago

#10 @audrasjb
3 months ago

  • Keywords needs-refresh added

@audrasjb
3 months ago

Refresh the patch and clean up some code

#11 @audrasjb
3 months ago

  • Keywords dev-feedback added; needs-refresh removed

Hi,

In 42135.4.diff, I refreshed the last patches and I edited up some function names and code.
I tested this code locally and it seems to work, but it will definitely needs a deep review.

Cheers,
Jb

#12 @desrosj
8 weeks ago

  • Milestone changed from 5.3 to Future Release

This still needs some work. With 5.3 beta 1 in a few hours, it needs to be punted.

Note: See TracTickets for help on using tickets.