Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Shamim Hasan

    (@shamim51)

    u want automatically send message after review and published?

    Thread Starter Orange

    (@weii)

    Yes, post audit by automatically sending messages to contributors.

    Plugin Author Shamim Hasan

    (@shamim51)

    function fep_publish_message($post_id) {
    	global $wpdb;
            $post = get_post($post_id);
            $author = get_userdata($post->post_author);
            $author_id = $author->ID;
    
    		$from = 1;  //change with your admin id
    		$title = 'SUBJECT';  //change message title
    		$content = 'MESSAGE';  //change message content
    		$date = current_time('mysql');
    		$table = $wpdb->prefix."fep_messages";
    
    		$wpdb->query($wpdb->prepare("INSERT INTO $table (from_user, to_user, message_title, message_contents, last_sender, date, last_date) VALUES ( %d, %d, %s, %s, %d, %s, %s )", $from, $author_id, $title, $content, $from, $date, $date));
    		}
    		add_action( 'pending_to_publish', 'fep_publish_message' );

    You can find lots of functions like this if you search in wordpress.org or google. If you find any difficulty u can contact with me anytime.
    `

    Thread Starter Orange

    (@weii)

    Hello, I have a problem. If simultaneously send e-mail that do it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to send a private message Contributors’ is closed to new replies.