Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 当用户下订单时,Magento能否向管理员发送电子邮件?_Php_Magento - Fatal编程技术网

Php 当用户下订单时,Magento能否向管理员发送电子邮件?

Php 当用户下订单时,Magento能否向管理员发送电子邮件?,php,magento,Php,Magento,当用户下订单时,Magento能否向管理员发送电子邮件 有必要将有关下订单的信息发送到管理员的电子邮件 管理员通知应该有另一个模板可以。您可以将所有订单设置为密件抄送 system>configuration>sales>sales email为了在我的Magento安装中做到这一点,我入侵了核心代码。正确编辑核心文件的第一级是在app/code/local中覆盖它们 让你的管理员命令通知电子邮件模板,保存它,并记下它的ID。我的是8。哦,要访问客户的电子邮件地址,请在模板中使用以下代码:{{{

当用户下订单时,Magento能否向管理员发送电子邮件

有必要将有关下订单的信息发送到管理员的电子邮件
管理员通知应该有另一个模板

可以。您可以将所有订单设置为密件抄送


system>configuration>sales>sales email

为了在我的Magento安装中做到这一点,我入侵了核心代码。正确编辑核心文件的第一级是在app/code/local中覆盖它们

让你的管理员命令通知电子邮件模板,保存它,并记下它的ID。我的是8。哦,要访问客户的电子邮件地址,请在模板中使用以下代码:
{{{var order.getCustomerEmail()}}
。这使我烦恼了好几个月P我的下一个技巧将是在管理订单通知电子邮件中对订单号进行条形码

现在,打开文件
app/code/core/Mage/Sales/Model/Order.php

<?
    $mailTemplate = Mage::getModel('core/email_template');
    /* @var $mailTemplate Mage_Core_Model_Email_Template */
//chris  near line 854:      $copyTo = $this->_getEmails(self::XML_PATH_EMAIL_COPY_TO);
    $copyMethod = Mage::getStoreConfig(self::XML_PATH_EMAIL_COPY_METHOD, $this->getStoreId());
    if ($copyTo && $copyMethod == 'bcc') {
        foreach ($copyTo as $email) {
//chris                $mailTemplate->addBcc($email);
        }
    }

//chris near line 900: added this to use admin email template for new orders. Note it is hard coded to template 8, which I added
        $mailTemplate->setDesignConfig(array('area'=>'frontend', 'store'=>$this->getStoreId()))
            ->sendTransactional(
                8,
                Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $this->getStoreId()),
                $this->_getEmails(self::XML_PATH_EMAIL_COPY_TO),
                "MyBusinessName Orders",
                array(
                    'order'         => $this,
                    'billing'       => $this->getBillingAddress(),
                    'payment_html'  => $paymentBlock->toHtml(),
                )
            );        
?>
getStoreId());
如果($copyTo&&$copyMethod=='bcc'){
foreach($copyTo作为$email){
//chris$mailTemplate->addBcc($email);
}
}
//chris靠近第900行:添加此项以使用新订单的管理电子邮件模板。注意,它是硬编码到模板8的,我添加了模板8
$mailTemplate->setDesignConfig(数组('area'=>'frontend','store'=>$this->getStoreId())
->发送事务性(
8.
Mage::getStoreConfig(self::XML\u PATH\u EMAIL\u IDENTITY,$this->getStoreId()),
$this->获取电子邮件(self::XML\u PATH\u EMAIL\u COPY\u TO),
“MyBusinessName订单”,
排列(
“订单”=>$this,
'计费'=>$this->getBillingAddress(),
“payment\u html”=>$paymentBlock->toHtml(),
)
);        
?>

CRM4电子商务扩展已加密,无法对其进行安全性审核

另一个免费选项是Inchoo管理命令通知程序

“Magento扩展,可在客户下单时向各种电子邮件发送电子邮件通知。当您希望您的人员通知某些客户刚刚下单时非常有用。支持事务性电子邮件。”


From:

管理员通知应该有另一个模板$layout=Mage::getModel('core/layout');$layout->getUpdate()->加载('sales\u email\u order\u items');$layout->generateXml()->generateBlocks();echo$ly=$layout->getOutput();这不起作用为什么?这不是你问的问题,没有上下文,我们无法告诉你为什么、什么或什么时候。