{"id":4392,"date":"2012-01-16T23:56:50","date_gmt":"2012-01-17T05:56:50","guid":{"rendered":"http:\/\/www.evolutionarydesigns.net\/blog\/?p=4392"},"modified":"2012-01-17T00:00:52","modified_gmt":"2012-01-17T06:00:52","slug":"wordpress-mondays-contributors","status":"publish","type":"post","link":"http:\/\/www.evolutionarydesigns.net\/blog\/2012\/01\/16\/wordpress-mondays-contributors\/","title":{"rendered":"WordPress Mondays: Are Your Contributors Getting Notified When You Publish Their Articles?"},"content":{"rendered":"<p>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\u2019t 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. <a href=\"https:\/\/i0.wp.com\/www.evolutionarydesigns.net\/blog\/wp-content\/uploads\/2012\/01\/fountain-pen.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border: 0px;\" title=\"fountain-pen\" src=\"https:\/\/i0.wp.com\/www.evolutionarydesigns.net\/blog\/wp-content\/uploads\/2012\/01\/fountain-pen_thumb.jpg?resize=604%2C313\" alt=\"fountain-pen\" width=\"604\" height=\"313\" border=\"0\" \/><\/a><\/p>\n<p>If you have the occasional writer, then it isn\u2019t 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. <em>Image Source: <\/em><a href=\"http:\/\/www.flickr.com\/photos\/joelmontes\/4762384399\/\" target=\"_blank\"><em>Journal Entry<\/em><\/a><\/p>\n<p>At first, this wasn\u2019t 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.<\/p>\n<p>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.<\/p>\n<h3>How to Make WordPress Automatically Email Writers that Their Articles are Live<\/h3>\n<p>Since I couldn&#8217;t remember what code I used, I did a search and came up with a great script from <a href=\"http:\/\/www.wprecipes.com\" target=\"_blank\">WPRecipes<\/a>.<\/p>\n<p>All you do is add the below function to the functions.php file in your editor.<\/p>\n<p>[php]<br \/>\nfunction wpr_authorNotification($post_id) {<br \/>\n   $post = get_post($post_id);<br \/>\n   $author = get_userdata($post-&gt;post_author);<\/p>\n<p>   $message = &quot;<br \/>\n      Hi &quot;.$author-&gt;display_name.&quot;,<br \/>\n      Your post, &quot;.$post-&gt;post_title.&quot; has just been published. Well done!<br \/>\n   &quot;;<br \/>\n   wp_mail($author-&gt;user_email, &quot;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. &quot;, $message);<br \/>\n}<br \/>\nadd_action(&#8216;publish_post&#8217;, &#8216;wpr_authorNotification&#8217;);<br \/>\n[\/php]<\/p>\n<p>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.<\/p>\n<p>Source Article: <a href=\"http:\/\/www.wprecipes.com\/how-to-automatically-email-contributors-when-their-posts-are-published\" target=\"_blank\">How to automatically email contributors when their posts are published<\/a> and <a href=\"http:\/\/wp.smashingmagazine.com\/2011\/10\/07\/definitive-guide-wordpress-hooks\/\" target=\"_blank\">WordPress Essentials: The Definitive Guide To WordPress Hooks<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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\u2019t sure you might want look into that? Some themes, may not have this function built into the theme. So that means you [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[1069,1067,1068,539],"class_list":["post-4392","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-automatic-publishing-emails","tag-contributors","tag-functions-php","tag-guest-writing","entry","has-post-thumbnail"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pJPdG-18Q","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/posts\/4392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/comments?post=4392"}],"version-history":[{"count":0,"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/posts\/4392\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/media?parent=4392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/categories?post=4392"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/tags?post=4392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}