- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Difference between setFlagImport(true) and setImportMode(true).
Hello everyone,
Hope you all are doing good.
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.
Ankita Biswas
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Difference between setFlagImport(true) and setImportMode(true).
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.