[wp-trac] [WordPress Trac] #49564: Allow users to set mail headers in wpmu_welcome_user_notification function

WordPress Trac noreply at wordpress.org
Mon Mar 2 18:12:15 UTC 2020


#49564: Allow users to set mail headers in wpmu_welcome_user_notification function
--------------------------------+-----------------------------
 Reporter:  ionvv               |      Owner:  (none)
     Type:  feature request     |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Networks and Sites  |    Version:
 Severity:  minor               |   Keywords:  has-patch
  Focuses:  multisite           |
--------------------------------+-----------------------------
 Hi,

 with multisite, when using {{{update_welcome_user_email}}} hook to change
 the email content it's not possible to send the email in HTML format
 because the header is hardcoded, see line 1700 in ms-functions.php
 https://core.trac.wordpress.org/browser/tags/5.3/src/wp-includes/ms-
 functions.php#L1700

 Maybe we can change the following:

 {{{
  $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" .
 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) .
 "\"\n";
 }}}

 to

 {{{
 $message_headers[] = "From: \"{$from_name}\" <{$admin_email}>\n";
 $message_headers[] = 'Content-Type: text/plain; charset="' . get_option(
 'blog_charset' ) . "\"\n";
 $message_headers = apply_filters( 'update_welcome_user_headers',
 $message_headers );
 }}}

 which will allow developers to filter headers with
 {{{update_welcome_user_headers}}}

 Let me know what you think about it.

 Warm regards,
 Ion

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49564>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list