简体   繁体   中英

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

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

It is necessary to send information about placed order to admin's email admin notification should have another template

Yes it can you can set all orders to be bcc -d from

system > configuration > sales > sales emails

I hacked core code to do this on my Magento install. The 1st level of properly editing core files is to override them in app/code/local somewhere...

Make your admin_order_notify_email template, save it, and note its ID. Mine was 8. Oh, and to get access to the customer's email address, use this code in the template: {{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.

Now, open the file 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.

Another free option is 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."

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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