Make WordPress Core

Opened 7 years ago

Closed 4 years ago

#42135 closed enhancement (duplicate)

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

Reported by: johnbillion's profile johnbillion Owned by: johnbillion's profile johnbillion
Milestone: Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: good-first-bug has-patch dev-feedback
Focuses: multisite Cc:

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 7 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 7 years ago.
Comment added for the filter.
42135.2.patch (3.1 KB) - added by cmachu 6 years 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 6 years 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 5 years ago.
Refresh the patch and clean up some code

Download all attachments as: .zip

Change History (19)

@kartikparmar
7 years ago

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

#1 @kartikparmar
7 years ago

  • Keywords has-patch added; needs-patch removed

@kartikparmar
7 years ago

Comment added for the filter.

#2 @johnbillion
7 years ago

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

#3 @johnbillion
7 years ago

  • Milestone changed from Future Release to 5.0

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


7 years ago

#5 in reply to: ↑ description @thomaswm
7 years 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
6 years ago

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

@dharmin16
6 years 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
6 years ago

  • Milestone changed from 5.0 to 5.1

#7 @pento
6 years ago

  • Milestone changed from 5.1 to 5.2

#8 @desrosj
5 years 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.


5 years ago

#10 @audrasjb
5 years ago

  • Keywords needs-refresh added

@audrasjb
5 years ago

Refresh the patch and clean up some code

#11 @audrasjb
5 years 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
5 years 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.

#13 @johnbillion
4 years ago

  • Milestone changed from Future Release to 5.6

#14 @johnbillion
4 years ago

  • Milestone 5.6 deleted
  • Resolution set to duplicate
  • Status changed from reviewing to closed

I'm closing this as a duplicate of #42134 because the functionality overlaps a lot and this will keep the discussion and patches in one place.

Note: See TracTickets for help on using tickets.