Created
June 21, 2017 19:38
-
-
Save hostedpixel/c9f3f015e0df0eb83971be298f41c57e to your computer and use it in GitHub Desktop.
Woocommerce | Send email when product review is approved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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