Make WordPress Core

Opened 7 years ago

Closed 6 months ago

Last modified 6 months ago

#47605 closed feature request (duplicate)

Email sender name change with site title in wp-includes/pluggable.php

Reported by: viitorcloudvc's profile viitorcloudvc Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.2
Component: Mail Keywords: has-patch
Focuses: Cc:

Description

A variable $from_name has default WordPress name as sender on line 316 in file name pluggable.php exist in wp-include folder.

Where there is a line replacement with site name of WordPress website. The result will show in email with Site title of website in email of sender name.

Attachments (3)

45562.patch.patch (509 bytes) - added by viitorcloudvc 7 years ago.
45562.patch.2.patch (506 bytes) - added by viitorcloudvc 7 years ago.
45562.patch (507 bytes) - added by viitorcloudvc 7 years ago.

Download all attachments as: .zip

Change History (14)

#1 follow-ups: @audrasjb
7 years ago

  • Component changed from General to Mail
  • Version 5.2.2 deleted

Hello @viitorcloudvc and welcome to WordPress Trac,

Thanks for the ticket, I'm moving it to the Mail component.

By the way, there is already a hook to filter the From Name parameter for all WP mails: https://developer.wordpress.org/reference/hooks/wp_mail_from_name/

Also, looks like there is an extra space that should be removed in the patch provided :-)

#2 @viitorcloudvc
7 years ago

Hello @audrasjb,

Thank you.

Thank you again for suggestion. I am aware about hook but it would be great to have default inbuilt function for sender name. For this purpose I am requesting to add in core functionality.

Last edited 7 years ago by viitorcloudvc (previous) (diff)

#3 in reply to: ↑ 1 @mukesh27
7 years ago

  • Keywords needs-refresh added
  • Version set to 2.2

As @audrasjb said there is already filter available to change default $from_name . please remove an extra space from 45562.patch.patch patch.

Replying to audrasjb:

Also, looks like there is an extra space that should be removed in the patch provided :-)

#4 @viitorcloudvc
7 years ago

Hello @audrasjb,

I have added new patch file. Please review it.

#5 in reply to: ↑ 1 @viitorcloudvc
7 years ago

Hello @audrasjb,

I have added new patch file named as:45562.patch.2.patch . Please review it.

Replying to audrasjb:

Hello @viitorcloudvc and welcome to WordPress Trac,

Thanks for the ticket, I'm moving it to the Mail component.

By the way, there is already a hook to filter the From Name parameter for all WP mails: https://developer.wordpress.org/reference/hooks/wp_mail_from_name/

Also, looks like there is an extra space that should be removed in the patch provided :-)

#6 @chetan200891
7 years ago

@viitorcloudvc Welcome to trac!

Looks like you have removed extra space before variable, but due to WPCS, you need to fix below errors,

Expected 1 space after opening bracket;
Expected 1 space before closing bracket;

:)

@viitorcloudvc
7 years ago

#7 @SergeyBiryukov
7 years ago

  • Keywords needs-refresh removed

#8 @viitorcloudvc
6 years ago

  • Type changed from enhancement to feature request

#9 @viitorcloudvc
6 years ago

  • Keywords needs-testing added

#10 @SirLouen
6 months ago

  • Keywords needs-testing removed
  • Resolution set to duplicate
  • Status changed from new to closed

This is quite tricky. For example, what happens with multisite?
For example, on creation of a new user, it will send an email
By using get_bloginfo( 'name' ); it will take the main blog, but maybe you would rather not disclose the main blog name when doing such.
The right way to proceed here is programmatically with wp_mail_from_name as @audrasjb and @mukesh27 have suggested.
There are already some proposals regarding the Senders mail (and transitively, sender's name), like #60420. For this reason, I'm going to be closing this as a duplicate to focus effort for a resolution just in one ticket.

#11 @peterwilsoncc
6 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.