Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

  • Khurshid Faizullaev
    Participant

    @loveplove

    thank you. works perfectly.

    I just had to put all three together

    add_filter(‘bp_email_use_wp_mail’, ‘__return_true’);

    add_filter( ‘wp_mail_content_type’, function( $content_type ) {
    $content_type = ‘text/html’;
    return $content_type;
    } );

    $must_use_wpmail = apply_filters( ‘bp_email_use_wp_mail’, $wp_html_emails || ! $is_default_wpmail );

    if ( $must_use_wpmail ) {
    $to = $email->get( ‘to’ );

    return wp_mail(
    array_shift( $to )->get_address(),
    $email->get( ‘subject’, ‘replace-tokens’ ),
    $email->get_template( ‘add-content’ )
    );
    }

    add_filter( ‘wp_mail’, function( $array ) {
    // Set conditions here.

    $array[‘message’] = ‘Change this’;
    return $array;
    } );

    DELETE THE FOLLOWING:

    $must_use_wpmail = apply_filters( ‘bp_email_use_wp_mail’, $wp_html_emails || ! $is_default_wpmail );

    if ( $must_use_wpmail ) {
    $to = $email->get( ‘to’ );

    return wp_mail(
    array_shift( $to )->get_address(),
    $email->get( ‘subject’, ‘replace-tokens’ ),
    $email->get( ‘content_plaintext’, ‘replace-tokens’ )
    );
    }

    LovePlove


    Khurshid Faizullaev
    Participant

    @loveplove

    Hi everyone. I am doing a site called https://loveplove.com

    After having read all forums, what worked for me was using WP Mail SMTP plugin was putting the following code. Please note I am just putting together various codes together from authors in those forums so you find it easily. In your bp-core-functions php file add the following:

    add_filter(‘bp_email_use_wp_mail’, ‘__return_true’);

    add_filter( ‘wp_mail_content_type’, function( $content_type ) {
    $content_type = ‘text/html’;
    return $content_type;
    } );

    $must_use_wpmail = apply_filters( ‘bp_email_use_wp_mail’, $wp_html_emails || ! $is_default_wpmail );

    if ( $must_use_wpmail ) {
    $to = $email->get( ‘to’ );

    return wp_mail(
    array_shift( $to )->get_address(),
    $email->get( ‘subject’, ‘replace-tokens’ ),
    $email->get_template( ‘add-content’ )
    );
    }

    add_filter( ‘wp_mail’, function( $array ) {
    // Set conditions here.

    $array[‘message’] = ‘Change this’;
    return $array;
    } );

    DELETE THE FOLLOWING:

    $must_use_wpmail = apply_filters( ‘bp_email_use_wp_mail’, $wp_html_emails || ! $is_default_wpmail );

    if ( $must_use_wpmail ) {
    $to = $email->get( ‘to’ );

    return wp_mail(
    array_shift( $to )->get_address(),
    $email->get( ‘subject’, ‘replace-tokens’ ),
    $email->get( ‘content_plaintext’, ‘replace-tokens’ )
    );
    }

    LovePlove

Viewing 2 replies - 1 through 2 (of 2 total)
Skip to toolbar