I am not getting Shipment data in getShipment() in below file while sending shipment tracking information email from admin

in vendor/magento/module-sales/Block/Order/Email/Shipment/Items.php

Any thoughts please ?

  • Any suggestions ?
    – devhs
    Commented Feb 17, 2021 at 9:35

1 Answer 1


Are you using a custom theme? If so check your shipment tracking email template in your child or parent theme :


There is an issue with deprecated code in older email templates.

Edit track.phtml and around line 28 replace

<?= $block->escapeHtml($_item->getNumber()) ?>


<a href="<?= $block->escapeUrl($block->getTrackingUrl()->getUrl($_item)) ?>" target="_blank"> <?= $block->escapeHtml($_item->getNumber()) ?> </a>

After making this change clear the cache and test again.

You can find more info about this issue here : https://github.com/magento/magento2/issues/25221

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.