Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Customizing emails template

@henrywright

Moderator

So if you want to edit also the headers and/or attachments you have to edit the BP core file adding the parameters and the corresponding filters

There is a way around that (you don’t have to edit core files).

Step 1: Filter bp_core_signup_send_validation_email_to so the default activation email isn’t sent

function filter_bp_core_signup_send_validation_email_to( $user_email, $user_id ) {
    $user_email = '';
    return $user_email;
}
add_filter( 'bp_core_signup_send_validation_email_to', 'filter_bp_core_signup_send_validation_email_to', 10, 2 );

Step 2: Send your own activation email

function my_custom_activation_email( $subject, $message, $user_id, $user_email, $key ) {
    // Create your $headers and $attachments here

    // Send the email.
    wp_mail( $user_email, $subject, $message, $headers, $attachments );
}
add_action( 'bp_core_sent_user_validation_email', 'my_custom_activation_email', 10, 5 );

Notes: I haven’t tested

Skip to toolbar