WordPress Mondays: Are Your Contributors Getting Notified When You Publish Their Articles?

Disclosure: We are a professional review site that receives compensation from the companies whose products we review. We test each product thoroughly and give high marks to only the very best. We are independently owned and the opinions expressed here are our own.

9 Flares Filament.io 9 Flares ×

Do you run a multi-authored blog or have the occasional guest writer submit articles to your site? If so, does WordPress automatically notify the author when their article is published? If you aren’t sure you might want look into that? Some themes, may not have this function built into the theme. So that means you will always have to email your writers when you submit their articles. fountain-pen

If you have the occasional writer, then it isn’t a big deal. However, if you have a lot of articles going live everyday or you like to set dates for the articles to go live in the future then you will want to setup WordPress to automatically tell the writers when their work goes live. Image Source: Journal Entry

At first, this wasn’t a big deal, but over time, I was getting more requests for guest writers. Since I usually set guest articles to go live on Fridays mornings I try and edit the article a few days to the night before and then set the article to go live the next morning. Because of this, I would sometimes forget to send out an email. To fix this problem, I had to write some code to automatically send out emails.

I went back to through my code and I realized that the original code I had written was no longer there. That means that sometime last year I over wrote the code and I had to rewrite the code again.

How to Make WordPress Automatically Email Writers that Their Articles are Live

Since I couldn’t remember what code I used, I did a search and came up with a great script from WPRecipes.

All you do is add the below function to the functions.php file in your editor.

[php]
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 has been published. Please check the article and let us know if anything needs to be changed. Please do not forget to Tweet, Like, and Google +1 the article. ", $message);
}
add_action(‘publish_post’, ‘wpr_authorNotification’);
[/php]

I did not make any changes to the function, but I did change the message. The original one was short and to the point. I wanted to add a reminder for the writers. You can basically put whatever message you want in there, just keep it short.

Source Article: How to automatically email contributors when their posts are published and WordPress Essentials: The Definitive Guide To WordPress Hooks

EvolutionaryDesigns.net runs on the Genesis Framework

Genesis Framework

Genesis empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go. It's that simple - start using Genesis now!


Take advantage of the 6 default layout options, comprehensive SEO settings, rock-solid security, flexible theme options, cool custom widgets, custom design hooks, and a huge selection of child themes ("skins") that make your site look the way you want it to. With automatic theme updates and world-class support included, Genesis is the smart choice for your WordPress website or blog.

About James

James spends most of his free time using social media and loves to teach others about design, web development, CSS, SEO, and social media. He is addicted to Wordpress, social media, and technology. You can reach him on his, personal website, Do not forget to follow him on Twitter @element321

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

9 Flares Twitter 8 Facebook 1 Pin It Share 0 Buffer 0 Email -- Filament.io 9 Flares ×
%d bloggers like this: