
Hello,
I have the plugin client portal. I wanted my users to get an email when I update their private page, so I asked the developer of the plugin. I can add the following code to my functions.php:
//Send an email to the user when his private page was updated
function cpc_send_email_on_page_update($post_id) {
$author_id = get_post_field('post_author', $post_id);
$user = get_userdata($author_id);
$to = $user->user_email;
$site_name = get_bloginfo('name');
$subject = '['.$site_name.'] Private page updated !';
$message = 'Your private page was just updated !';
wp_mail($to, $subject, $message);
}
add_action( 'save_post_private-page', 'cpc_send_email_on_page_update' );
When I activate the twenty seventeen theme the extra code in the functions.php works fine. But when I activate the Themler theme I made, it does not work.
I added the code in the functions.php of both the Twenty Seventeen theme and my Themler theme.
Does anyone know what can be the problem?
Hello, I have the plugin client portal. I wanted my users to get an email when I update their private page, so I asked the developer of the plugin. I can add the following code to my functions.php: //Send an email to the user when his private page was updated function cpc_send_email_on_page_update($post_id) { $author_id = get_post_field('post_author', $post_id); $user = get_userdata($author_id); $to = $user->user_email; $site_name = get_bloginfo('name'); $subject = '['.$site_name.'] Private page updated !'; $message = 'Your private page was just updated !'; wp_mail($to, $subject, $message); } add_action( 'save_post_private-page', 'cpc_send_email_on_page_update' ); When I activate the twenty seventeen theme the extra code in the functions.php works fine. But when I activate the Themler theme I made, it does not work. I added the code in the functions.php of both the Twenty Seventeen theme and my Themler theme. Does anyone know what can be the problem?