Home Forums BP Better Messages Email link – page not found Reply To: Email link – page not found

#6252
gingerbooch
Participant

Ok I got it ! Thanks for the filter 🙂

function add_tokens($arr, $ud, $sender, $thread_id) {
    $arr = array(
	'messages.html' => $messageHtml,
	'messages.raw'  => $messageRaw,
	'user.name'     => $ud->display_name,
	'sender.name'   => $sender->display_name,
	'thread.id'     => $thread_id,
	'thread.url'    => esc_url( BP_Better_Messages()->functions->get_link( $user_id ) . '?thread_id=' . $thread_id ),
	'subject'       => sanitize_text_field( stripslashes( $messages[ 0 ]->subject ) ),
	'unsubscribe'   => esc_url( bp_email_get_unsubscribe_link( array(
	'user_id'           => $user_id,
	'notification_type' => 'messages-unread',
	) ) )
	);
    return $arr;
    return $ud; ///
    return $sender; ///
    return $thread_id; ///
}
add_filter( 'bp_better_messages_notification_tokens', 'add_tokens', 10, 4);