简体   繁体   English

用户下单时Magento可以发email给管理员吗?

[英]Can Magento send email to admin, when user place order ?

Can Magento send email to admin, when user place order?用户下单时Magento可以发email给管理员吗?

It is necessary to send information about placed order to admin's email admin notification should have another template有必要将有关已下订单的信息发送给管理员的 email 管理员通知应该有另一个模板

Yes it can you can set all orders to be bcc -d from是的,您可以将所有订单设置为 bcc -d from

system > configuration > sales > sales emails

I hacked core code to do this on my Magento install.我破解了核心代码以在我的 Magento 安装中执行此操作。 The 1st level of properly editing core files is to override them in app/code/local somewhere...正确编辑核心文件的第一级是在 app/code/local 某处覆盖它们......

Make your admin_order_notify_email template, save it, and note its ID.制作您的 admin_order_notify_email 模板,保存并记下它的 ID。 Mine was 8. Oh, and to get access to the customer's email address, use this code in the template: {{var order.getCustomerEmail()}} .我的是 8。哦,要访问客户的 email 地址,请在模板中使用此代码: {{var order.getCustomerEmail()}} This vexed me for months.这让我烦恼了几个月。 :P My next trick will be to barcode the order number in the admin order notification email. :P 我的下一个技巧是在管理员订单通知 email 中为订单号添加条形码。

Now, open the file app/code/core/Mage/Sales/Model/Order.php现在,打开文件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(),
                )
            );        
?>

The crm4ecommerce extension is encrypted, and cannot be audited for security. crm4ecommerce 扩展已加密,无法进行安全审计。

Another free option is Inchoo Admin Order Notifier.另一个免费选项是 Inchoo Admin Order Notifier。

"Magento extension that enables email notifications towards various emails when customer places the order. Useful when you want your personell notified that some customer just placed the order. Supports transactional email." “当客户下订单时,Magento 扩展可以向各种电子邮件发送 email 通知。当您希望您的人员通知某些客户刚刚下订单时很有用。支持交易 email。”

From: https://github.com/ajzele/Inchoo_AdminOrderNotifier来自: https://github.com/ajzele/Inchoo_AdminOrderNotifier

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM