Hi,
I want to trigger an automated script from Trustpilot when customers check out from their cart.
I managed to verify my site on Trustpilot and somehow I can activate Trustpilot's automated email script.
Originally the code was 'John@gmail.com' instead of '{$data->order->email|escape}' etc...
The original code activates the script.
But when I want to edit the code with customer data from EventGallery's email template the script doesn't work.
<script>
document.addEventListener('DOMContentLoaded', function() {
const trustpilot_invitation = {
recipientEmail: '{$data->order->email|escape}',
recipientName: '{$data->order->billingaddress->firstname}',
referenceId: '{$data->order->documentnumber}',
source: 'InvitationScript',
};
tp('createInvitation', trustpilot_invitation);
});
</script>
I put this code in my index.php, but according to Trustpilot's documentation it should be in the review html section. (Very limited explanation on Trustpilot on this topic)
Should I use different codes for my customer data or put the script somewhere else for instance /html/com_eventgallery/checkout/review.php ? But there is no <head> section.
I hope you could help me.
Best regards.
Kris