问题描述:
后台运单信息点击Send Tracking Information没有发送邮件。
出现如下空白页面提示:
解决方式:
在模板目录重写track.phtml.php
文件位置:magento目录\app\design\frontend\模板所有者\模板名称\Magento_Sales\templates\email\shipment\track.phtml
内容如下
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php /* @var \Magento\Framework\View\Element\Template $block */ ?>
<?php $_shipment = $block->getShipment() ?>
<?php
/* @var \Magento\Sales\Model\Order $_order */
$_order = $block->getOrder() ?>
<?php if ($_shipment && $_order) : ?>
<?php $trackCollection = $_shipment->getTracksCollection() ?>
<?php if ($trackCollection) : ?>
<br />
<table class="shipment-track">
<thead>
<tr>
<th><?= $block->escapeHtml(__('Shipped By')) ?></th>
<th><?= $block->escapeHtml(__('Tracking Number')) ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($trackCollection as $_item) : ?>
<tr>
<td><?= $block->escapeHtml($_item->getTitle()) ?>:</td>
<td>
<a href="<?= $block->escapeUrl($this->helper('Magento\Shipping\Helper\Data')->getTrackingPopupUrlBySalesModel($_item)) ?>" target="_blank">
<?= $block->escapeHtml($_item->getNumber()) ?>
</a>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>
<?php endif; ?>