Magento – which phtml file is use for New Order Confirmation Template for Guest/Seller

email-templatesmagento-2.1.3order-emailphtmlsales-order

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());
$imagewidth=30;
$imageheight=30;
//$_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.

Best Answer

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}}

order_new

{{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"}}
Related Topic