Add missing total line

In the example I will use our gift card extension, but this method should work with all other 3rd party extensions. Our gift card extension adds additional line in order, invoice and creditmemo totals, when gift card is applied during purchase.

1. Copy layout xml to your design folder

The first step is to copy layout xml file to your design folder:

app/code/Magetrend/Email/view/frontend/layout/mtemail_sales_totals.xml

copy to

app/design/frontend/VENDOR/THEME/Magetrend_Email/layout/mtemail_sales_totals.xml

2. Find missing totals line block

The second step is to find totals line block in extension layout file. Your file could be different, but it should have related parts. Gift Card extension layout's file is located here:

app/code/Magetrend/GiftCard/view/frontend/layout/sales_email_order_items.xml

Your module also should has sales_email_order_items.xml file in frontend layouts.

Gift card extension layout file content looks following

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Order Items List" design_abstraction="custom">
    <body>
        <referenceBlock name="order_totals">
            <block class="Magetrend\GiftCard\Block\Sales\Order\GiftCard" name="giftcard_discount" template="Magetrend_GiftCard::sales/email/order/giftcard.phtml">
                <action method="setIsPlaneMode">
                    <argument name="value" xsi:type="string">1</argument>
                </action>
            </block>
        </referenceBlock>
    </body>
</page>

From this file we need a block which are the child of order_totals block. The following code is what we are looking for from this file.

<block class="Magetrend\GiftCard\Block\Sales\Order\GiftCard" name="giftcard_discount" template="Magetrend_GiftCard::sales/email/order/giftcard.phtml">
     <action method="setIsPlaneMode">
        <argument name="value" xsi:type="string">1</argument>
     </action>
</block>

3. Update a layout file

Open the file

app/design/frontend/VENDOR/THEME/Magetrend_Email/layout/mtemail_sales_totals.xml

and insert the block code like in the picture bellow as a child of order_totals

After clearing the caches, new line should be added. The same process is with invoice and credit memo. Just the blocks should be added as a child of invoce_totals and creditememo_totals.