Skip to:
Content

BuddyPress.org

Changeset 10697


Ignore:
Timestamp:
04/12/2016 08:03:48 PM (9 years ago)
Author:
djpaul
Message:

Emails: add support for wp_mail_from and wp_mail_from_name filters

Improves compatibility with plugins that configure WordPress to send emails via SMTP.

Fixes #6999 (2.5 branch)

Props thebrandonallen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/src/bp-core/classes/class-bp-email.php

    r10594 r10697  
    173173
    174174        // This was escaped with esc_html on the way into the database in sanitize_option().
    175         $site_name = wp_specialchars_decode( bp_get_option( 'blogname' ), ENT_QUOTES );
    176 
    177         $this->set_from( "wordpress@$domain", $site_name );
    178         $this->set_reply_to( bp_get_option( 'admin_email' ), $site_name );
     175        $from_name    = wp_specialchars_decode( bp_get_option( 'blogname' ), ENT_QUOTES );
     176        $from_address = "wordpress@$domain";
     177
     178        /** This filter is documented in wp-includes/pluggable.php */
     179        $from_address = apply_filters( 'wp_mail_from', $from_address );
     180
     181        /** This filter is documented in wp-includes/pluggable.php */
     182        $from_name = apply_filters( 'wp_mail_from_name', $from_name );
     183
     184        $this->set_from( $from_address, $from_name );
     185        $this->set_reply_to( bp_get_option( 'admin_email' ), $from_name );
    179186
    180187        /**
Note: See TracChangeset for help on using the changeset viewer.