Integrate Trustpilot’s Automatische Feedback Service With Woocommerce

Try the WooCommerce Trustpilot Plugin now. This plugin sends the Trustpilot’s BCC email after order processing or completing.

Trustpilot is an open, community-based platform for sharing real reviews of shopping experiences online. You can use Trustpilot with your web shop. To ask customs for reviews Trustpilot sends e-mails. When you open a account you get a unique (secret) e-mail-address to send your order information to. Trustpilot’s software scans this e-mails for the e-mail-address of customer and your orderID. Trustpilot use this information to ask your customers for reviews.

With Automatische Feedback Service e-mails are send directly after the order. You can do this by sending a Bcc (blind carbon copy) of your confirmation e-mail to your unique Trustpilot e-mail-address. Woocommerce has no setting to send such Bcc message by default. To send you blind copy you have to change the code of Woocommerce.

Find the file /wp-content/plugins/woocommerce/classes/class-wc-email.php on your webserver first. Trustpilot ask you to send your order conformation e-mail. Woocommerce also sends an order complete message. I use the order complete message to send the blind copy. In the file mentioned before look up the customer_completed_order function. If you prefer to send the blind copy with the confirmation use the customer_processing_order function.

customer_completed_order contain the line:
$headers = apply_filters('woocommerce_email_headers', '', 'customer_processing_order', $order);

Add the following line of code after this line (replace with your own unique e-mailaddress):
$headers .= 'Bcc:'."\r\n";

That’s all. Remember this solution isn’t a hook for Woocommerce so you have to repeat this steps when you update your Woocommerce plugin every time.

Update for Woocommerce 2 In Woocommerce 2 the structure of the mail class has been changed. To send your Bcc message to Trustpilot you have to add the email address to /wp-content/plugins/woocommerce/classes/emails/class-wc-email-customer-completed-order.php or wc-email-processing-order.php if you like. The function trigger calls $this->send() change the fifth parameter from $this->get_headers() to this->get_headers().'Bcc:'."\r\n".

14 Responses to “Integrate Trustpilot’s Automatische Feedback Service With Woocommerce”

  1. Andreas

    Thank you. But it seems like Trustpilot doesn’t scan the email sent by woocommerce correct.
    I get an error in my trustpilot dashboard, saying that there was an error sending the email.

    • admin

      Hi Andreas, can you tell me more about this error? I didn’t found any problems. Beside the e-mail address to the headers i also add the orderid to the subject. To change the subject of the e-mail you have to change the second parameter of the call to this->send(). I use:
      $this->get_subject().' (Order '.$order_id.')'. Maybe this helps? You can test your service by sending a test mail with tptest as name.

  2. Kim Christensen

    When I add this code to my e-mail then entire ordersystem crashed.. not able to show content of a single order

    We run 2.0.12 shop and need to hook up with trustpilot.

    The function trigger calls $this->send() change the fifth parameter from
    $this->get_headers() to

    I have found the line.. but it crashes the shop and no email is received at trustpilot.

    Have to inform that we use a plugin called “WooCommerce Order Status Manager” and this can send custom emails, but we don’t use this on the “completed order” part.. that’s the original from woo..

  3. admin

    Hi Kim,

    To be sure, the line to add should not end with a dot but with a semicolon.
    Could you provide me the errors you got (from your log files or from running WP in de debug mode).

    I will try to write a plugin which add this bcc without changing the code this week.

    Good luck

    • admin

      Hi Guy,

      Well if have studied the integration document. The method of FEEFO is very different to that from Trustpilot. Writing a new plugin for FEEFO can be done. FEEFO requires an xml file (that can be upload or served for FEEFO).
      As far as i understand now, it is not required to create new data after each sale. In fact you should write a plugin that convert the WooCommece data to xml data as required by FEEFO.

      Best regards,


  4. andrijana

    Good day,
    I’m Andrijana from WebHostingGeeks Support. We have found your plugin WooCommerce Trustpilot at very interesting and of a significant use for the community. Since I’m of Serbian decent, I’m willing to help people from former Yugoslavia, which now represents six independent countries in Europe, better manage their internet pages by translating your plugin into Serbo-Croatian language.
    Would that be ok with you?
    I hope I’ll hear from you soon.

    Many kind regards,

    Andrijana Nikolic

  5. andrijana

    A few weeks ago, I send you request to translate your WooCommerce Trustpilot plugin. But I didn’t get answer regarding my offer to you. Please let me know if you agree with my proposal.

    Sincerely your,
    Andrijana Nikolic


Leave a Reply

(will not be published)