Customizing Buddypress Activation Emails (and still get activation key)
-
Hi,
I have the following filters set up in my theme’s functions.php file to make a custom activation email for new users. Most everything works, but the only problem is the activation url does not pull trough the activation key, it’s just blank after ‘?key=’ what am I missing here to get the activation key (and avoid having to alter bp-core files):
/*FILTERS FOR CUSTOM BUDDYPRESS ACTIVATION EMAIL*/
function change_bp_activation_subject($subject) {
$from_name = ( ” == get_site_option( ‘site_name’ ) ) ? ‘WordPress’ : esc_html( get_site_option( ‘site_name’ ) );
return __( ‘Activate Your Account With Our Forums Today’, ‘buddypress’ );
}
add_filter(‘bp_core_activation_signup_user_notification_subject’, ‘change_bp_activation_subject’);
function change_bp_activation_message($message) {
$activate_url = bp_get_activation_page() . “?key=$key”;
$activate_url = esc_url($activate_url);
$email = is_admin() ? ‘&e=1′ : ”;
return sprintf( __( “Greetings,\n\nYou have subscribed to our new community website. \n\n To complete the activation of your account and to set up a new password, please click the following link:\n\n%1\$s\n\n \Thanks for taking the time to complete your subscription!”, ‘buddypress’ ), $activate_url . $email );
}
add_filter(‘bp_core_activation_signup_user_notification_message’, ‘change_bp_activation_message’);
/*END – CUSTOM BUDDYPRESS ACTIVATION EMAIL*/
You must be logged in to reply to this topic.