是否可以在 Magento 中以编程方式发送电子邮件?也许您可以从自定义模块中的 Controller 获取模板、填充其变量并发送电子邮件?
谢谢。
最佳答案
当然。这是 Checkout 助手的示例:
$mailTemplate = Mage::getModel('core/email_template');
$template = Mage::getStoreConfig('checkout/payment_failed/template', $checkout->getStoreId());
$mailTemplate->setDesignConfig(array('area'=>'frontend', 'store'=>$checkout->getStoreId()))
->sendTransactional(
$template,
Mage::getStoreConfig('checkout/payment_failed/identity', $checkout->getStoreId()),
$recipient['email'],
$recipient['name'],
array(
'reason' => $message,
...
'total' => $total
)
);
关于email - 是否可以在 Magento 中以编程方式发送电子邮件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5582691/