Email Notification when a new customer has been added - Magento

后端 未结 7 1032
鱼传尺愫
鱼传尺愫 2021-01-03 06:31

I would like to send an email notification to my store\'s contact email address every time when a new customer has been Registered.

I don\'t want to purchase any kin

7条回答
  •  孤街浪徒
    2021-01-03 07:22

    This is code for sending new customer email to Admin also
    Override file
    \app\code\core\Mage\Customer\Model\Customer.php
    to local
    \app\code\local\Mage\Customer\Model\Customer.php

    Replace below function

    protected function _sendEmailTemplate($template, $sender, $templateParams = array(), $storeId = null)
        {
            /** @var $mailer Mage_Core_Model_Email_Template_Mailer */
            $mailer = Mage::getModel('core/email_template_mailer');
            $emailInfo = Mage::getModel('core/email_info');
            $emailInfo->addTo($this->getEmail(), $this->getName());
            $mailer->addEmailInfo($emailInfo);
    
            // Set all required params and send emails
            $mailer->setSender(Mage::getStoreConfig($sender, $storeId));
            $mailer->setStoreId($storeId);
            $mailer->setTemplateId(Mage::getStoreConfig($template, $storeId));
            $mailer->setTemplateParams($templateParams);
            $mailer->send();
            return $this;
        }
    

    to

    protected function _sendEmailTemplate($template, $sender, $templateParams = array(), $storeId = null)
        {
            /** @var $mailer Mage_Core_Model_Email_Template_Mailer */
            $mailer = Mage::getModel('core/email_template_mailer');
            $emailInfo = Mage::getModel('core/email_info');
            $emailInfo->addTo($this->getEmail(), $this->getName());
    
            if($template="customer/create_account/email_template"){
    
                $emailInfo->addBcc(Mage::getStoreConfig('trans_email/ident_general/email'), $this->getName());
                  //Add email address in Bcc you want also to send
            }
    
            $mailer->addEmailInfo($emailInfo);
    
    
            // Set all required params and send emails
            $mailer->setSender(Mage::getStoreConfig($sender, $storeId));
            $mailer->setStoreId($storeId);
            $mailer->setTemplateId(Mage::getStoreConfig($template, $storeId));
            $mailer->setTemplateParams($templateParams);
            $mailer->send();
            return $this;
        }
    

提交回复
热议问题