Something that really helps conversion rates and exacerbates the interest in your products is social proof.
The most common form of social proof is reviews and testimonials.
A lot of WooCommerce store owners use third-party platforms to capture reviews, like Klaviyo, MailChimp, SendinBlue, Zapier … the list goes on!
The issue with third-party platforms is that there is usually a cost that comes with it (both monetary and time).
This snippet makes the above redundant and will send the customer an email automatically so you don’t have to lift a finger or fork out hundreds for an email automation platform!
In this particular example, I have set the email to send 7 days after the order status is set to “complete” and asks the user to rate their order on TrustPilot.
You may wish to change the number of days until the email is sent, the email subject, and email body to meet your requirements.
/**
* Snippet Name: WooCommerce Send Review Follow-up Email After Order Complete
* Snippet Author: ecommercehints.com
*/
add_action( 'woocommerce_order_status_completed', 'ecommercehints_send_review_followup_email_after_order_complete' );
function ecommercehints_send_review_followup_email_after_order_complete( $order_id ) {
$order = wc_get_order( $order_id );
$order_date = $order->get_date_created();
$order_date_timestamp = strtotime( $order_date );
$current_date_timestamp = strtotime( date( 'Y-m-d H:i:s' ) );
$difference = $current_date_timestamp - $order_date_timestamp;
$days = floor( $difference / (60*60*24) );
if ( $days == 7 ) { // Number of days until the email is sent
$to = $order->get_billing_email();
$subject = 'How was your order?';
$message = 'Hey '. $order->get_billing_first_name() . ',
How was your order? We\'d love to hear your feedback on TrustPilot here';
$headers = array('Content-Type: text/html; charset=UTF-8');
wp_mail( $to, $subject, $message, $headers );
}
}