You can use transition_post_status function, then fetch users and send an email to all users.

Here is a sample code, it's not tested. But it will get you started with this.

function wcs_send_mail_on_publish_category_posts( $new_status, $old_status, $post ) {

    global $post;

    if ( 'publish' !== $new_status or 'publish' === $old_status ) return;

    if ( in_category( array( '12', '34' ) ) ) {

        $subscribers = get_users( array ( 'role' =&gt; 'subscriber' ) );
        $emails      = array ();

        foreach ( $subscribers as $subscriber )
            $emails[] = $subscriber-&gt;user_email;

        $body = sprintf( 'Hey there is a new entry! See &lt;%s&gt;', get_permalink( $post )  );

        wp_mail( $emails, 'New entry!', $body );

    }

}

add_action( 'transition_post_status', 'wcs_send_mail_on_publish_category_posts', 10, 3 );


Send email when publish new post in certain categories
I am looking for a way to highlight or use different face of quoted text in plain text. It seems that there should be a sophisticated/enhanced text mode but I cannot find it. 

If there isn't a easy solution, can you let me know where should I begin to write a function?

Thank you very much!

A noob who has been using Emacs from 19.xx
