I triedam trying to get imageproduct images for invoice email template. I used below code. Just i'mBut I am only getting magentoMagento placeholder image in email template.
<td>
<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product_id = $_item->getOrderItem()->getProduct();
$product = $objectManager->get('Magento\Catalog\Model\Product')->load($product_id);
$_imagehelper = $objectManager->get('Magento\Catalog\Helper\Image');
$image_url = $_imagehelper->init($product, 'cart_page_product_thumbnail')->getUrl();
?>
<img src="<?php echo $image_url; ?>" alt="<?php echo $product->getName(); ?>" />
</td>
Please help to solve this solution.
Thank you.