• Resolved asaadqamar

    (@asaadqamar)


    As the question states I want to send notification to admin of website (wordpress) when someone add Review to the website, I searched about It and find two code snippet attached below:

    1:

    function new_comment_moderation_recipients( $emails, $comment_id ) { return array( ‘[email protected]’ ); } add_filter( ‘comment_moderation_recipients’, ‘new_comment_moderation_recipients’, 24, 2 ); add_filter( ‘comment_notification_recipients’, ‘new_comment_moderation_recipients’, 24, 2 );

    And 2:

    public static function comment_moderation_recipients( $emails, $comment_id ) {
    $comment = get_comment( $comment_id );
    if ( $comment && ‘product’ === get_post_type( $comment->comment_post_ID ) ) {
    $emails = array( get_option( ‘admin_email’ ) );
    }
    return $emails; }

    The first one I added to “function.php”, but not work for me. And for the Second(2nd) Code snippet when I add It, My website is facing a syntax error.

    Can you please help me out with this?

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • AJ a11n

    (@amandasjackson)

    Hi @asaadqamar

    By default WordPress sends a notification to the author of the product/post.

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Notify Admin When someone add Review on Woocommerce Product?’ is closed to new replies.