Copy a piece of code from the Internet:
How to automatically email contributors when their posts are published,Copy the code below and paste it on my functions.php file.
function wpr_authorNotification($post_id) {
$post = get_post($post_id);
$author = get_userdata($post->post_author);
$message = "
Hi ".$author->display_name.",
Your post, ".$post->post_title." has just been published. Well done!
";
wp_mail($author->user_email, "Your article is online", $message);
}
add_action('publish_post', 'wpr_authorNotification');
"Your article is online" and “ has just been published. Well done!” for other languages,How to modify the code and po files?Thank you for your help!














