1

I have use in the Email templates "New Shippment" the variable tracking numer detail The variable in BO magento 2 Email templates :

{{block class='Magento\Framework\View\Element\Template' area='frontend' template='Magento_Sales::email/shipment/track.phtml' shipment=$shipment order=$order}}

When i recieve the email i get no informations of tracking informations

I use magento version 2.3.5-p1 , i wanna just get the informations of tracking number in email shippment.

The variable of Order Summary is also empty

2 Answers 2

1

Use that line tracking number will be show I hope it will be helpful

   {{layout handle="sales_email_order_shipment_track" shipment_id=$shipment_id order_id=$order_id}}

Like that

<tr class="email-information">
    <td>
        {{depend comment}}
        <table class="message-info">
            <tr>
                <td>
                    {{var comment|escape|nl2br}}
                </td>
            </tr>
        </table>
        {{/depend}}
        {{layout handle="sales_email_order_shipment_items" shipment=$shipment order=$order}}
        <table class="order-details">
            <tr>
                <td class="address-details">
                    <h6 style="color:#000;text-transform: uppercase;">{{trans "Billing Info"}}</h6>
                    <p>{{var formattedBillingAddress|raw}}</p>
                </td>
                {{depend order.getIsNotVirtual()}}
                <td class="address-details">
                    <h6 style="color:#000;text-transform: uppercase;">{{trans "Shipping Info"}}</h6>
                    <p>{{var formattedShippingAddress|raw}}</p>
                </td>
                {{/depend}}
            </tr>
            <tr>
                <td class="method-info">
                    <h6 style="color:#000;text-transform: uppercase;">{{trans "Payment Method"}}</h6>
                    {{var payment_html|raw}}
                </td>
                {{depend order.getIsNotVirtual()}}
                <td class="method-info">
                    <h6 style="color:#000;text-transform: uppercase;">{{trans "Shipping Method"}}</h6>
                    <p>{{var order.getShippingDescription()}}</p>
                </td>
                {{/depend}}
            </tr>
        </table>
        {{layout handle="sales_email_order_shipment_track" shipment_id=$shipment_id order_id=$order_id}}
    </td>
</tr>
0

The block Magento\Framework\View\Element\Template is pretty generic, and I pretty sure that it will not deal with any tracking information.

I would recommend you change your class block for: Magento\Sales\Block\Order\Email\Shipment\Items

I am afraid that the {{block ...}} directive will not work for you. Instead of that, you can use the directive {{handle ... }} like below:

{{layout handle="sales_email_order_shipment_track" shipment_id=$shipment_id order_id=$order_id}}

You can find the same directive on Magento's shipment emails:

https://github.com/magento/magento2/blob/2.3/app/code/Magento/Sales/view/frontend/email/shipment_new.html#L64

I hope it helps you, good luck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.