This custom code snippet enables you to automatically send emails to anyone who leaves a starred review in WooCommerce.
You can send emails based on any rating between 1 to 5 stars. In this example, the code sends an email you can customize, to anyone who leaves a 5 star review.
![](https://wpsites.net/wp-content/uploads/2024/07/wc-eviews-email-600x200.png)
Copy and paste the following PHP code to the end of your child themes functions file or custom functionality/code snippet plugin.
Code Modification
Swap out the 5 in the code to any other rating between 1 and 5.
Swap out the content between the “” double quotes to personalize your email message.
Extended Version
A new and improved extended version of this code enables you to customize the email address, email subject heading and email content.
The code can be modified and extended to do anything you need.
Need More Coding Help?
Was This Tutorial Helpful?