21.5 C
Saturday, June 15, 2024

How to Send Writers an Email in WordPress Upon Publication of an Article

Would you like writers to receive emails from WordPress when their articles are published?

Notifying authors when their blog entries are published helps to keep them informed if you manage a multi-author blog. Authors may easily share their content and take part in debates, which can also assist boost engagement on your website.

We’ll explain in this article how to email writers as soon as their pieces are posted on WordPress.

Why Does WordPress Send Writers Emails Upon Publication of Their Articles?
When authors receive notification from your WordPress blog about the publication of their works, it allows them to promptly share their work on social media and interact with readers in the comments section.

Notifications also inform authors on the progress of certain posts’ publications. By demonstrating your appreciation for the writer’s efforts to your multi-author blog, you foster trust within your team.

By notifying authors as soon as their work is published, you also allow them to review it and fix any mistakes or typos before readers have a chance to read it.

That being said, let’s look at how to quickly contact writers when their WordPress posts are published. The following links will allow you to quickly access the technique of your choice:

Method 1: Use a plugin to email the author when their article is published in WordPress

Method 2: Use Code to Send the Author an Email When Their Article Publishes in WordPress

Bonus: Send Emails Using WordPress Mail SMTP

Method 1: Use a plugin to email the author when their article is published in WordPress

This approach is appropriate if you would rather notify your authors via a plugin.

First, you need to install and activate the PublishPress Planner plugin.

Note: Additional features like Slack connection, reminder notifications, and meta posts can be unlocked with the PublishPress Pro plan. This will assist you in enhancing your multi-author blog’s editorial workflow as a whole.

After activation, navigate to the ‘Notifications’ tab on the Planner » Settings page using the WordPress admin sidebar.

Once there, enter the admin email address next to the “Email from” option, which will be used to send emails to your authors.

Next, make sure to select the option to “Always notify the author of the content” so that you can alert writers each time one of their contributions gets published on your website.

You can select the option to “Always notify users who have edited the content” if you would also like to let the people who edited the post know.

When you’re finished, save your changes by clicking the “Save Changes” button.

Authors will now receive the following email notification after their post is published:

Method 2: Use Code to Send the Author an Email When Their Article Publishes in WordPress

You can add code to your theme’s functions.php file to automatically send emails to authors if you don’t want to utilize a plugin.

But even the smallest mistake when adding code can cause your website to malfunction and become unavailable.

That’s why we advise use WPCode at all times. It is the best WordPress code snippets plugin on the market that makes it super safe and easy to add custom code to your website.

Installing and activating the WPCode plugin is the first step.

Note: You can also use WPCode’s free plan for this tutorial. However, upgrading to the pro version will give you access to more features like a code snippets library, conditional logic, CSS snippets, and more.

Just go to the Code Snippets > + Add Snippet page from the WordPress dashboard after activation. Next, select “Add Your Custom Code (New Snippet)” and click the “Use Snippet” button.

After you get to the “Create Custom Snippet” page, you can begin by giving the code snippet a title.

Next, from the Code Type dropdown menu on the right, choose “PHP Snippet.”

Currently, copy and paste the customized code that follows into the “Code Preview” box:

function notifyauthor($post_id) {
$post = get_post($post_id);
$author = get_userdata($post->post_author);
$subject = "Post Published: ".$post->post_title."";
$message = "
      Hi ".$author->display_name.",
      Your post, \"".$post->post_title."\" has just been published.
      View post: ".get_permalink( $post_id )."
   wp_mail($author->user_email, $subject, $message);
add_action('publish_post', 'notifyauthor');

When a new post is published on WordPress, this code is activated. It uses the code-defined subject and message to send the author an email notification. You are welcome to modify the message and subject areas to suit your needs.

After completing that, select the “Auto Insert” mode by scrolling down to the “Insertion” section. Upon activation, the code will be executed automatically on your website.

Lastly, return to the top of the screen and flip the “Inactive” switch to “Active.”

Next, save your settings by clicking the “Save Snippet” button.

The author will now receive an email notification automatically when a post is published.

This is how it will appear:

Bonus: Send Emails Using WordPress Mail SMTP

You are utilizing WordPress’s default email settings—which aren’t always dependable—when you correspond with your authors regarding their published content.

This implies that the author may not receive your email or it may possibly land in their spam bin.

The greatest WordPress SMTP plugin available is WP Mail SMTP, which you may use to resolve this problem. It solves your email delivery issues by transmitting mail using the SMTP (Simple Mail Transfer Protocol).

Popular email marketing platforms can be readily connected to WP Mail SMTP to ensure that users receive your emails right away.

You may send emails to your users using prepared templates, employ backup connections and failure alarms, watch your email logs, and effortlessly avoid the spam folder with WordPress Mail SMTP.

We hope that this post has been helpful in teaching you how to send authors an email after their work is posted on WordPress.

Related Articles


Please enter your comment!
Please enter your name here

Latest Articles