In some code I'm writing right now, I have something like this:

if (uncommon_condition) {
    do_something_simple();
} else {
    do();
    something();
    long();
    and();
    complicated();
}


Part of me thinks "It's fine the way it's written. Simple cases should go first and more complicated cases should go next." But another part says: "No! The else code should go  under the if, because if is for dealing with unusual cases and else is for dealing with all other cases." Which is correct or preferable?


Question: Email sent to store owner after a new account is created
Answer: Use Magento Event/Observer functionality for this:


  app/etc/modules/Namespace_Modulename.xml


&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;config&gt;
    &lt;modules&gt;
        &lt;Namespace_Modulename&gt;
            &lt;active&gt;true&lt;/active&gt;
            &lt;codePool&gt;local&lt;/codePool&gt;
        &lt;/Namespace_Modulename&gt;
    &lt;/modules&gt;
&lt;/config&gt;



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


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



  app/locale/en_US/template/notify_new_customer.html


Congratulations, a new customer has been registered:&lt;br /&gt;
Name: {{var name}}&lt;br /&gt;
Email: {{var email}}&lt;br /&gt;
...&lt;br /&gt;



  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')
            -&gt;loadDefault('notify_new_customer');
        $emailTemplate
            -&gt;setSenderName(Mage::getStoreConfig('trans_email/ident_support/name'))
            -&gt;setSenderEmail(Mage::getStoreConfig('trans_email/ident_support/email'))
            -&gt;setTemplateSubject('New customer registered');
        $result = $emailTemplate-&gt;send(Mage::getStoreConfig('trans_email/ident_general/email'),(Mage::getStoreConfig('trans_email/ident_general/name'), $observer-&gt;getCustomer()-&gt;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.