TransWikia.com

Order receipt email content

Drupal Answers Asked by Pete L on December 8, 2021

I have a Drupal 8.6.7 site with Commerce 8.x-2.11 installed. I would like to include slightly more information in the emails sent out when customers complete the checkout process. I would like to reference both the equipment category field and a more general category field present in both the product and product variations.

At the moment I just see the Title, Unit Price and Quantity if I look at the list of orders (all tests right now) at /Administration/Commerce/Orders.

Is there a way of adding these fields through the web admin GUI so that they end up in an order receipt email? I also have ‘MIME Mail’ and ‘Mail System’ modules installed if that helps.

One Answer

This is not really an answer but closer to one than I've been before; even though I cannot go any further.

In /core/themes/bartik/templates I've placed a copy of commerce-order-receipt.html.twig. I can change the wording in this template, refresh the cache and I can see that come through in new emails. I see there's a mention of an 'order_entity' which I do not know how to reference so it appears in an email receipt.

If you can see the screenshot I've uploaded, it may become clear where I'm at or where I'm going wrong.

Order Item

I thought I might be able to change one of the columns in the order item (as the current four columns are exactly those that appear in receipt emails) and then try and reference it through {{ order_entity.getSomething }} in commerce-order-receipt.html.twig (after clearing the cache).

If I can get the fields in 'Purchased Entity' into the receipt email, I can then complete my business case for my Drupal site as everything else works a treat.

Thanks again.

Answered by Pete L on December 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP