I added a field to set email address for each Customer Group No need when the customer place an order send order email copy to his Group email.

Thanks to help me in this point...

1 Answer 1


You need to override the Mage_Sales_Model_Order class via the


directory or rewrite it in your custom extension.

You set two tags to this question:

magento-1.9 and magento-1.8

So if you are using Magento or newest, then you need to add some code to the queueNewOrderEmail function otherwise into the sendNewOrderEmail function.

Please find the following line of code:

if ($this->getCustomerIsGuest())

and add the following code into the else statement:

$customerGroup = Mage::getModel('customer/group')->load($this->getCustomerGroupId());
if ($customerGroup->getEmail()) {
    $copyTo[] = $customerGroup->getEmail(); // getting value from your custom field

it should look like this:

if ($this->getCustomerIsGuest()) {
    $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_GUEST_TEMPLATE, $storeId);
    $customerName = $this->getBillingAddress()->getName();
} else {
    $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE, $storeId);
    $customerName = $this->getCustomerName();
    $customerGroup = Mage::getModel('customer/group')->load($this->getCustomerGroupId());
    if ($customerGroup->getEmail()) {
        $copyTo[] = $customerGroup->getEmail();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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