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 ?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityAre you using a custom theme? If so check your shipment tracking email template in your child or parent theme :
THEME\Magento_Sales\view\frontend\templates\email\shipment\track.phtml
There is an issue with deprecated code in older email templates.
Edit track.phtml
and around line 28 replace
<?= $block->escapeHtml($_item->getNumber()) ?>
with
<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