Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hostedpixel/c9f3f015e0df0eb83971be298f41c57e to your computer and use it in GitHub Desktop.
Save hostedpixel/c9f3f015e0df0eb83971be298f41c57e to your computer and use it in GitHub Desktop.
Woocommerce | Send email when product review is approved.
add_action('comment_unapproved_to_approved', 'comment_approved');
function comment_approved($comment) {
$comment_product_id = $comment ->comment_post_ID;
if ( get_post_type($comment_product_id) == 'product' ) {
//if is true
if(is_email($comment->comment_author_email) ) {
wp_mail( '$email', 'Here is code: review25 ' . $post->post_title, $comment );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment