user3663821
user3663821

Reputation: 21

Send account confirmation email to specific customer group in magento

How to send account confirmation email to specific customer group in magento

I want to send confirmation email only a specific customer group. please any one can help in this issue....

I already save the customer group during registration or new account creation by using below link:-

http://phpmagento.blogspot.in/2012/01/how-to-show-customer-group-selecter-in.html

Upvotes: 0

Views: 1563

Answers (3)

user3663821
user3663821

Reputation: 21

Go to the \app\code\core\Mage\Customer\Model\Customer.php

replace

        <pre>
            public function isConfirmationRequired()
                {   
                    if ($this->canSkipConfirmation()) {
                        return false;
                    }
                    if (self::$_isConfirmationRequired === null) {
                        $storeId = $this->getStoreId() ? $this->getStoreId() : null;
                        self::$_isConfirmationRequired = (bool)Mage::getStoreConfig(self::XML_PATH_IS_CONFIRM, $storeId);

                    }

                    return self::$_isConfirmationRequired;
                }
        </pre>

with:

            public function isConfirmationRequired()
                {
if ($this->canSkipConfirmation()) { return false; } if (self::$_isConfirmationRequired === null) { $storeId = $this->getStoreId() ? $this->getStoreId() : null; if($this->getGroupId() == 2) { self::$_isConfirmationRequired = (bool)Mage::getStoreConfig(self::XML_PATH_IS_CONFIRM, $storeId); } }

return self::$_isConfirmationRequired; } </pre>

Where 2 is the wholesale group Id.

Upvotes: 1

MagePal Extensions
MagePal Extensions

Reputation: 17656

I Don't think you can without do some customization in magento.

Try

  1. Disable All Email Confirmation. see How To Enable/Disable Email confirmation for New Account

  2. Then create an observer for on customer save. see magento customer_save_after model / observer not called, catch customer -> edit -> save function

  3. Check to see if the customer is a new customer and in the correct group (may need to check if the got confirmation email before)

  4. Copy the logic that send Email confirmation from base magento into your observer

Upvotes: 0

Gerard de Visser
Gerard de Visser

Reputation: 8050

Account confirmation email is sent when creating customer. Customer group is added to customer after customer account is created.

So it's not possible to send confirmation email to only a specifik customer groep.

Upvotes: 0

Related Questions