Skip to:
Content
Pages
Categories
Search
Top
Bottom

filter for wp_mail_from stops working with activated buddypress.

  • @garprogram

    Participant

    Hi everyone. Thank in advance.

    I am using filters to change the default email address for wordpress but have stopped working when buddypress is active.

    add_filter(‘wp_mail_from’, ‘foo_new_mail_from’);
    add_filter(‘wp_mail_from_name’, ‘foo_new_mail_from_name’);

    If buddypress deactivate, this works like a charm.

    I use the latest versions of WordPress and BuddyPress

Viewing 4 replies - 1 through 4 (of 4 total)
  • @garprogram

    Participant

    This is an issue of buddypress?.
    Are there equivalent filters to buddypress?

    Sorry for my english…..

    Thanks

    @garprogram

    Participant

    Solved…..

    
    add_action( 'bp_email', function( $email_type, &$email_obj ) {
        $email_obj->set_from( "custom@example.com", "Custom Website Name" );
    }, 10, 2 );
    

    @garprogram

    Participant

    Hi @djpaul .

    This was only a cosmetic decision, I prefer to send emails from an address of my choice.

    Great work BuddyPress team.
    Thanks,,,

    @thebrandonallen

    Participant

    For anyone using the wp_mail_from and wp_mail_from_name filters, commonly used in SMTP plugins, I’ve created a plugin that lets those filters work with BP emails.

    https://wordpress.org/plugins/bp-email-to-wp-mail-from-bridge/

    Hope this helps someone!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar