Home > Back-end >  How to Get Email Notification for Post Changes in WordPress
How to Get Email Notification for Post Changes in WordPress

Time:01-06

By default, WordPress doesn’t send notifications when posts are changed by a user.

How to Get Email Notification for Post Changes in WordPress?

I want to get notification when user update/change post

CodePudding user response:

Below is a basic example that will send an email every time a post or page is updated on your website.

function my_project_updated_send_email( $post_id ) {

    // If this is just a revision, don't send the email.
    if ( wp_is_post_revision( $post_id ) ) {
        return;
        }

    $post_title = get_the_title( $post_id );
    $post_url = get_permalink( $post_id );
    $subject = 'A post has been updated';

    $message = "A post has been updated on your website:\n\n";
    $message .= $post_title . ": " . $post_url;

    // Send email to admin.
    wp_mail( '[email protected]', $subject, $message );
}
add_action( 'save_post', 'my_project_updated_send_email' );

For more detail please click see the docs

CodePudding user response:

To get email notifications for post changes in WordPress, you can use the "Post Status Notifier" plugin. This plugin allows you to set up email notifications for various post status transitions, such as when a post is published, pending review, or scheduled for future publishing.

Here's how to set up email notifications for post changes in WordPress using the Post Status Notifier plugin:

Install and activate the Post Status Notifier plugin.

Go to Settings > Post Status Notifier in your WordPress dashboard.

Under the "Global Settings" section, enter the email address(es) that you want to receive notifications. You can also specify the sender name and email address for the notifications.

Scroll down to the "Post Status Transition Settings" section. Here, you can select which post status transitions should trigger email notifications, and customize the subject and content of the notification emails.

Click the "Save Changes" button to save your settings.

From now on, you will receive email notifications whenever the selected post status transitions occur on your WordPress site.

  • Related