diff --git a/wp-content/plugins/bp-dedication/includes/bp-dedication-create-dedication.php b/wp-content/plugins/bp-dedication/includes/bp-dedication-create-dedication.php index 5c9de10..eb59d00 100644 --- a/wp-content/plugins/bp-dedication/includes/bp-dedication-create-dedication.php +++ b/wp-content/plugins/bp-dedication/includes/bp-dedication-create-dedication.php @@ -127,7 +127,8 @@ function bp_dedication_create_new_dedication() { if (count($friend_ids) > 1) { $friend_info = get_userdata($friend_ids[1]); add_post_meta($post_id, 'ghostpool_destination_user_id', $friend_info->ID); - add_post_meta($post_id, 'ghostpool_destination_user_name', $friend_info->user_login); + add_post_meta($post_id, 'ghostpool_destination_user_name', $friend_info->user_login); + $friend_email = $friend_info->user_email; } if (isset($friend_email) && (is_email($friend_email))) { @@ -178,7 +179,7 @@ function bp_dedication_create_new_dedication() { /*$user_id = $bp->loggedin_user->id; $user_link = bp_core_get_userlink($user_id);*/ - do_action( 'bp_dedication_create_new_dedication', $post_id, $friend_info->ID, $bp->loggedin_user->id); + do_action( 'bp_dedication_create_new_dedication', $post_id, $friend_email, $bp->loggedin_user->id); return true; } diff --git a/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php b/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php index 3255e2e..527ca8c 100644 --- a/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php +++ b/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php @@ -1,19 +1,17 @@ dedications->slug . '/new-dedication/user/' . $from_user_id; + //$sender_profile_link = bp_core_get_userlink($from_user_id, false, true); $enc_link = bp_dedication_encode(get_permalink($post_id)); @@ -21,7 +19,6 @@ function bp_dedication_send_dedication_notification( $post_id, $to_user_id, $fro $post_link = add_query_arg('refid', $enc_link, $post_link); /* Set up and send the message */ - $to = $reciever_ud->user_email; $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s dedicated a song 2 u!', 'bp-dedication' ), stripslashes($sender_name) ); $message = sprintf( __( @@ -35,7 +32,7 @@ To see %s\'s dedication: %s //$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'bp-example' ), $reciever_settings_link ); // Send it! - wp_mail( $to, $subject, $message ); + $result = wp_mail( $to_user_email, $subject, $message ); } add_action( 'bp_dedication_create_new_dedication', 'bp_dedication_send_dedication_notification', 10, 3 );