Best 2 Know

The Ultimate Blogging Resource

  • Advertising
  • WebHosting
  • Contact Us
  • Blogger
    • Blogger Templates
    • Blogger Tutorials
  • Browser
    • Firefox
    • Google Chrome
  • Google
  • Internet
    • Facebook
    • Twitter
  • Thesis
  • Windows
  • WordPress
    • WordPress Themes
    • WordPress Plugins
  • More
    • Linux
    • Review
    • Solutions
    • Announcements

How to automatically email contributors when theirs post is published

When you run a blog with many authors, and you want the author of the post to know that his post has been published but you cannot email contributors each time their posts is published, so for that I have a solution for automatically email contributors of post that their post is published.

Well it is really simple just you have to paste the below code :

function wpden_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', 'wpden_authorNotification');

Now every time you publish the post the WordPress will email contributors of the respective posts. also take a look at How to Automatically notify users on new post

Subscribe via Email

Share this:

  • Twitter
  • Facebook
  • Pocket
  • Print
  • WhatsApp
  • Email

Related

January 23, 2012 Ritesh Sanap WordPress Email Address, email contributors, functions.php, Hacks, wordpress hacks

Leave a Reply Cancel reply

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

Post navigation

Previous Previous post: How to run android apps on PC – BlueStacks
Next Next post: How to remove category from WordPress URL

Currently Trending

  • How to download Specific parts of YouTube videos
  • How to Change the Welcome/Login Screen in Windows XP ?
  • Windows Vista CD key
  • HTTP2 Server Push for W3 Total Cache Minify plugin
  • Embed Text Resizing Widget To Increase or Decrease The Font Size
  • Free Online Angry Birds game
  • Different way’s to shutdown your pc
  • Check if your Antivirus Is Working Properly
  • Free Online Virus and Malware Scan
  • NTFS vs. FAT

Get Latest post in your Inbox

Random Posts

How to specify the Auto save Interval

April 20, 2012 By Ritesh Sanap Leave a Comment

Authy to Manage all your Google Authenticator accounts

June 5, 2015 By Ritesh Sanap Leave a Comment

Make Acrobat Reader Load Faster

February 29, 2008 By Ritesh Sanap Leave a Comment

Leviathan – Blogger Template

July 16, 2010 By Ritesh Sanap 2 Comments

Google Talk for Chrome – Chat for Google

December 2, 2012 By Ritesh Sanap Leave a Comment

WordPress

HTTP2 Server Push for W3 Total Cache Minify plugin

August 17, 2016 By Ritesh Sanap 5 Comments

How to Disable Emojis in WordPress

January 6, 2016 By Ritesh Sanap Leave a Comment

JetPack Related posts and Sharing not working with NGINX

November 10, 2015 By Ritesh Sanap Leave a Comment

Simply Pure – WordPress Theme

November 2, 2014 By Ritesh Sanap 2 Comments

Advanced What should we Write about next? – WordPress Plugin

July 28, 2014 By Ritesh Sanap Leave a Comment

How to Disable Self Pingback or TrackBack

January 16, 2014 By Ritesh Sanap Leave a Comment

BlueStrap – WordPress Theme

January 1, 2014 By Ritesh Sanap 15 Comments

How to Create Multiple Excerpts in WordPress

December 24, 2013 By Ritesh Sanap Leave a Comment

How to Disable Auto Update in WordPress

November 21, 2013 By Ritesh Sanap Leave a Comment

How to Delete Feedbacks from JetPack Contact Form

November 19, 2013 By Ritesh Sanap 9 Comments

Recent Posts

  • HTTP2 Server Push for W3 Total Cache Minify plugin
  • How to show hidden files and folders in Mac OS X
  • How to Disable Emojis in WordPress
  • Canva – Online Photo Editor
  • JetPack Related posts and Sharing not working with NGINX

Archives

Recommends

  • DigitalOcean – Cloud Hosting
  • Dropbox – Cloud Storage
  • Elegant Themes – WordPress Themes
  • LastPass – Password Manager
  • Like us on Facebook
  • Follow on Twitter
  • +1 on Google
  • Subscribe via Email
  • RSS Feed

© 2023 Best 2 Know · All Rights Reserved · We ♥ DigitalOcean