i have created and implemented the code to call product thumbnail and product url for "New Order Confirmation Template" thats is use for customers.my code is below

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->create('Magento\Catalog\Model\Product')->load($_item->getProduct()->getId());
//$_product = $objectManager->get('Magento\Catalog\Model\Product')->load($_item->getProductId());
$imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');
$image_url = $imageHelper->init($product, 'product_page_image_small')->setImageFile($product->getFile())->resize($imagewidth, $imageheight)->getUrl();

    <div class="product-name"><a href="<?= $_item->getProduct()->getProductUrl(); ?>"> <?= $block->escapeHtml($_item->getName()) ?></a></div>
    <div class="sku"><?= /* @escapeNotVerified */  __('SKU'); ?>: <?= $block->escapeHtml($block->getSku($_item)) ?></div>
    <div class="sku"><a href="<?= $_item->getProduct()->getProductUrl(); ?>"> <img src="<?= $image_url?>"></a></div>

This is my code which iam using in module-sales/view/frontend/templates/email/items/order in default.html. now this template get called in module-sales/view/frontend/templates/email items.phtml to call default.phtml contents.

now my query is when i order something this customized mail along with product thumbnail and product url is going to customers but its not going to seller.

now what i have done is create an email template via sales configuration and callingthe same items.phtml block as below

Thank you{{config path="trans_email/ident_custom1/name"}} for your order.

{{block class="Magento\Framework\View\Element\Template" order=$order name="order_sms" template="module_sales::items.phtml" area="frontend"}}

when iam seeing my customized mail iam getting only Thank youCustom 1 for your order. and the block which i have mentioned at top is not reflecting. what is the issue and can please any body tell me what default email template is use to send out to new guest so that i can customize it accordingly confused.

  • so i want to add product thumbnail and product url in order_new_guest.html. how to achieve that sir? earlier you have told me about adding same coding in default.phtml and it worked but only for customer. how to add same thing in order_new_guest.html ?so that product thumbnail and product url is visible to seller also Commented Feb 24, 2017 at 5:53

1 Answer 1


This is path of email template magento-slaes/view/frontend/email/order_new_guest.html

the difference between the layout handles order_new_guest

{{layout handle="sales_email_order_items" order=$order}}


{{layout handle="sales_email_order_items" order=$order area="frontend"}}

Now adding the are in gues template and then check area="frontend"

{{layout handle="sales_email_order_items" order=$order area="frontend"}}
  • so i want to add product url & product thumbail in that so that seller can see the same.how to ahieve this sir?ealier i have done in default.phtml and it worked but how to achieve the same using html file? i want to show same product thumbnail and product url in the email template goes to seller Commented Feb 24, 2017 at 5:55
  • @YogeshRaghav i added the possible solution for that Commented Feb 24, 2017 at 5:56
  • where i suppose to add this code sir? in email-template content or directly in order_new_guest.html nad where to place it sir? Commented Feb 24, 2017 at 6:03
  • @YogeshRaghav yes change in the template html file and check the output Commented Feb 24, 2017 at 6:04
  • sir i have changed the template as u said but seller is not getting the same email.product link and images are missing in that email. i have registered as seller ,assigned product and tried my self but as a customer i got email along with product link and images but when i logged in my emiam as a seller iam not getting mail along with images and product url. where is the issue sir? Commented Feb 24, 2017 at 11:42

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.