I am not aware of any default notification mechanism within Pods, so user interface for this would depend on which plugins are used to send the notification, and fixing it without changing anything would also depend on how it has been configured.
Assuming the notification is an email, and assuming the pending posts are created with [pods-form]
, wp-admin
, or any form method which ends up creating or updating post with post type pending
, this is the generic action for sending an email when a post status changes is https://developer.www.ads-software.com/reference/functions/wp_transition_post_status/ combined with https://developer.www.ads-software.com/reference/functions/wp_mail/
Here is a minimal example which sends an email when a post type of type post
has its status set to Pending Review
, where the emails notified are gathered from three locations including a site-wide Settings field, and the email contents contains links to both the page to edit and the URL it will be published on:
<?php
add_action(
'transition_post_status',
function( $new_status, $old_status, $post ) {
// Send an email if:
// - The status has changed to "Pending Review" from something else.
// - The post_type is 'post'.
if(
$old_status !== $new_status
&& 'pending' === $new_status
&& 'post' === $post->post_type
) {
// Set the email content type to HTML.
add_filter( 'wp_mail_content_type','set_wp_mail_to_html', 1000 );
// Send the notification.
wp_mail(
// An array of recipient addresses.
array_unique( // Remove duplicates.
array_merge( // Combine emails from various sources.
[
// Author of the Post.
get_user_by( 'ID', $post->post_author )->user_email,
],
[
// Site admin.
get_option( 'admin_email' ),
],
// A list of emails, separated by returns, stored in a Plain Paragraph Text field on a Settings Page created with Pods. The Settings Page is called notification_settings and the field is called people_to_notify.
(array) explode(
PHP_EOL,
(string) get_option( 'notification_settings_people_to_notify' ),
),
)
),
// Subject.
'?? Pending Review: ' . $post->post_title,
// Email HTML body.
sprintf(
<<<'TEMPLATE'
<p>The post <a href="%s">%s</a> is ready for review.</p>
<p>Click the link to edit or publish to <a href="%s">%s</a>.</p>
TEMPLATE,
esc_url( get_edit_post_link( $post->ID ) ),
esc_html( $post->post_title ),
get_permalink( $post->ID ),
get_permalink( $post->ID )
),
// Optional additional headers, such as BCC.
[],
// Optional attachments.
[]
);
// Set the email content type back to default.
remove_filter( 'wp_mail_content_type','set_wp_mail_to_html', 1000 );
}
},
20,
3
);
function set_wp_mail_to_html() {
return 'text/html';
}