email - 是否可以在 Magento 中以编程方式发送电子邮件?

标签 email magento

是否可以在 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/

相关文章:

javascript - Facebook javascript sdk 不返回电子邮件地址

ios - 以编程方式提取设置包 iOS 中的默认电子邮件帐户

vb.net - VB : Email sending with SMTP is failing

magento - 我可以在 magento 1.5 中为产品分配多个属性集吗?如果不是如何处理这个问题?

magento - 当平面目录产品数据打开时如何从 magento EAV 表中选择

iphone - 在 iPhone HTML 邮件中显示本地镜像

linux - web2py:发送电子邮件:从本地主机进行 EHLO 后失去连接

Magento 1.9.2.3,从后端上传图片后,权限设置为640而不是644

magento - CSS 文件的顺序。在主题的 CSS 之前加载模块的 CSS

php - Magento CSRF 保护