Importing customers into Magento without newsletter subscription notification

Importing customers into Magento without newsletter subscription notification
September 13th by Sander
Posted in Blog

Recently we had a fairly large customer base we had to import from an ePages shop into Magento. During import with dataflow profiles, using some test data, we found that all email addresses of the test data received a newsletter subscription succes email (we imported clients with column is_subscribed set to 1). Sending tens of thousands of newsletter succes mails was not what we wanted, so here’s a pragmatic way to turn that off for the initial import only:

Open file app/code/core/Mage/Newsletter/model/Subscriber.php. Disable the line containing “sendConfirmationSuccessEmail() in the function called “subscribeCustomer()”). Now, your customers will not receive newsletter confirmation emails on importing.

Background: the dataflow customer import saves customer data using a regular save action on the customer object. The newsletter module of Magento listens for a customer save event and fires the subscribeCustomer() function when that happens. Of course, enable the line you edited in the subscribeCustomer() function again after you’re done!

Share / bookmark:
  • Reddit
  • Digg
  • Sphinn
  • del.icio.us
  • Google Bookmarks
  • RSS
 
Author: Sander

2 Comments

  1. dawolf
    18:03 on November 30th, 2009

    Thanks for the tip! Worked after I removed the sendConfirmationSuccessEmail() function call from the subscribe() functionin Subscriber.php

    This Magento forum post answers how to import emails from an array or csv after you remove the confirmation mail: http://www.magentocommerce.com/boards/viewthread/7626/

  2. Mike
    12:53 on January 17th, 2010

    Got it working by deleting the following segment:

    elseif ($this->getIsStatusChanged() && $status == self::STATUS_SUBSCRIBED) { $this->sendConfirmationSuccessEmail(); }

Leave a Reply