Custom notification for contributors when posts are scheduled

Instead of rely on global $post, you should use the post object passed to function via the posts status transition: add_action(‘pending_to_future’, ‘scheduledNotification’); add_action(‘approved_to_future’, ‘scheduledNotification’); function scheduledNotification( $post ) { $author = get_userdata($post->post_author); // the rest of your function here }

Email notification

$ticket is a WP_Post object. It should have all of the information you need. Just add that information to the $message string to create whatever content you want. Bare-bones example: $message=”You are viewing “.$ticket->post_title; $message .= ‘Post Content: ‘.$ticket->post_content; $message .= ‘View it: ‘ . get_permalink( $ticket->ID ) . “\nEdit it: ” . get_edit_post_link( $ticket->ID … Read more

Send email from WordPress

Try to add some code to the functions.php like: add_action(‘publish_post’,’send_email’); function send_email() { // write some code with wp_mail function. } I think you can use the $post to get the post info. For comments I guess you can use: add_action(‘comment_post’, ‘send_email’); Let me know if you need some more help!

Can we validate user email changes?

You can use this hook to send a mail to your old email address <?php add_action( ‘profile_update’, ‘my_profile_update’, 10, 2 ); function my_profile_update( $user_id, $old_user_data ) { //Load new user data by uid and compare with old data // Email code about profile changes } ?> I think this should work for you.

Get emails of register user in WordPress

The user table column you are searching for is user_email $emails = new WP_User_Query( array( ‘fields’ => array( ‘display_name’, ‘user_email’, ), // you don’t want everything, right? ‘orderby’ => ’email’, // ‘user_email’ works as well ‘order’ => ‘ASC’, // default: ‘DESC’ ‘number’ => 10, // total amount of users to return ‘offset’ => 0, // … Read more