cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between setFlagImport(true) and setImportMode(true).

Difference between setFlagImport(true) and setImportMode(true).

Hello everyone,

 

Hope you all are doing good.Smiley Happy

 

I am trying to subscribe new customers through importing csv. 

	Mage::getModel('newsletter/subscriber')->setImportMode(true)->setData('country','')->subscribe($email);

here i want to set country to NULL. But it is not happening.

 

But when i used setFlagImport(true) insted of setImportMode(true), it works fine.

	Mage::getModel('newsletter/subscriber')->setFlagImport(true)->setData('country','')->subscribe($email);

 So, my question is why is it so? Can anyone tell me the difference between setFlagImport(true) and setImportMode(true) while importing csv.

 

 

 

Magento Developer
Ankita Biswas
1 REPLY 1

Re: Difference between setFlagImport(true) and setImportMode(true).

Hi @Ankita Biswas

 

There is no such attribute Flag Import in Magento Core, so you cannot use setFlagImport and getFlagImport in Magento core.

 

In Magento core setImportMode() is managing for sending newsletter action email, like if setImportMode(true) then no email will be send to customer regarding subscription, update or unsubscription.

 

Example:

 

 

public function sendConfirmationRequestEmail()
    {
        if ($this->getImportMode()) {
            return $this;
        }

 

 

This is the class: 

Mage_Newsletter_Model_Subscriber

  

 

Must be setFlagImport is using in your custom module.

 

To find more search 

getFlagImport()

in your whole project.