order mail 直接打印到页面上

位置

vendor\magento\module-sales\Model\Order\Email\Sender.php
Magento\Sales\Model\Order\Email\Sender::prepareTemplate()

添加代码

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$templateFactory = $objectManager->create(
    'Magento\Framework\Mail\TemplateInterface',
    ['data' => ['template_id' => $this->templateContainer->getTemplateId()]]
);
$templateFactory->setOptions($this->templateContainer->getTemplateOptions());
$templateFactory->setVars($this->templateContainer->getTemplateVars());
echo $templateFactory->processTemplate();
exit();

猫之良品
2.5k 声望139 粉丝

资深Drupal, magento与Joomla


引用和评论

0 条评论