Reply To: How to automatically send messages to newly registered users?


Home Forums Front End PM PRO How to automatically send messages to newly registered users? Reply To: How to automatically send messages to newly registered users?

#10341
laowei
Participant
function fep_cus_user_post_send_messaage($post_id){
	
	global $post_id;
        $post = get_post($post_id);
        $author = get_userdata($post->post_author);
        $author_id = $author->ID;
		$post_title = $post->post_title;
		$post_link = get_permalink($post);
	
	
        if ($post->post_type !== 'post')
                return;
        if ( ! function_exists( 'fep_send_message' ) )
                return;
        // Prepare message data
        $message = array(
             'message_title' => 'title', //change with message title
             'message_content' => 'xxx', //change with message content
             'message_to_id' => $user_id
        );
	
        $override = array(
             'post_author' => 1, //change with message sender id
        );

        // Send message
       fep_send_message( $message, $override );      
}
add_action( 'pending_to_trash', 'fep_cus_user_post_send_messaage', 10, 1 );

This does not seem to work