Send automatic email when editing in post
-
I found this feature, I think you can put it in your plugin so that when you edit a post, it automatically notifies all subscribers of that post. With this method, there is no need to click the Resend Notification button.
You can adapt it to the plugin:
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( 'admin@example.com', $subject, $message ); } add_action( 'save_post', 'my_project_updated_send_email' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Send automatic email when editing in post’ is closed to new replies.