1

We need the same email confirmation after a new account is created to be sent to the store owner email. Emails are sending fine to customer, but not sure if this is default functionality to send that email to store owner as well? If not, please advise how to make this happen.

  • 1
    email to store owner is not a default functionality. to do this you have to override a customer controller or write a event observer. – MeenakshiSundaram R Jul 15 '14 at 2:44
2

Use Magento Event/Observer functionality for this:

app/etc/modules/Namespace_Modulename.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Namespace_Modulename>
            <active>true</active>
            <codePool>local</codePool>
        </Namespace_Modulename>
    </modules>
</config>

app/code/local/Namespace/Modulename/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Namespace_Modulename>
            <version>0.0.1</version>
        </Namespace_Modulename>
    </modules>
    <frontend>
        <events>
            <customer_register_success>
                <observers>
                    <unic_observer_name>
                        <type>model</type>
                        <class>unic_class_group_name/observer</class>
                        <method>customerRegisterSuccess</method>
                    </unic_observer_name>
                </observers>
            </customer_register_success>
        </events>
        <helpers>
            <unic_class_group_name>
                <class>Namespace_Modulename_Helper</class>
            </unic_class_group_name>
        </helpers>
    </frontend>
    <global>
        <models>
            <unic_class_group_name>
                <class>Namespace_Modulename_Model</class>
            </unic_class_group_name>
        </models>
        <template>
            <email>
                <notify_new_customer module="Namespace_Modulename">
                    <label>Template to notify administrator that new customer is registered</label>
                    <file>notify_new_customer.html</file>
                    <type>html</type>
                </notify_new_customer>
            </email>
        </template>
    </global>
</config>

app/locale/en_US/template/notify_new_customer.html

Congratulations, a new customer has been registered:<br />
Name: {{var name}}<br />
Email: {{var email}}<br />
...<br />

app/code/local/Namespace/Modulename/Model/Observer.php

class Namespace_Modulename_Model_Observer
{
    public function customerRegisterSuccess(Varien_Event_Observer $observer)
    {
        $emailTemplate  = Mage::getModel('core/email_template')
            ->loadDefault('notify_new_customer');
        $emailTemplate
            ->setSenderName(Mage::getStoreConfig('trans_email/ident_support/name'))
            ->setSenderEmail(Mage::getStoreConfig('trans_email/ident_support/email'))
            ->setTemplateSubject('New customer registered');
        $result = $emailTemplate->send(Mage::getStoreConfig('trans_email/ident_general/email'),(Mage::getStoreConfig('trans_email/ident_general/name'), $observer->getCustomer()->getData());
    }
}

Please Refer to this link, as it it the reference of the source code. It also shares that this code will not work on register while checkout, whereas the solution is share in the link. Please click HERE for more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.