You are in: development / content management systems / magento tutorial / import magento customers without sending newslette

Don't stress'em

In the last days I've faced, working at the Magento project I'm mainly involved nowadays, that when you import customers from the magento's native import tool the system send a confirmation email to all the customers that you want to subscribe to the newsletter natively.

This can be great for ready-to-go-live sites that import customers - almost - on the fly but when you need to make some tests importing the old customers from an application that was managing 16k+ people this can be really bad.

So, in order not to stress them with useless confirmation emails, let's see what we can do.

First of all you can edit all customer's emails, to, then, re-edit them in order to create invalid emails ( john@doe.com => mysitetryingtocontact.john@doe.com ).

I didn't choose this practice because, after importing them, you need to re-edit data in the db, and everybody who knows Magento is conscious about "the less you see the Magento's DB, the more you are happy".

Wink

So, I looked for the method which was sending that emails, found in

// I truly don't know why an email sending passage goes in a Model...
app/code/core/Mage/Newsletter/Model/Subscriber.php

The only thing you gotta do is to put a return true at the first line of the sendConfirmationSuccessEmail method.

After having succesfully imported the data, delete the return.

Add your comment

Name:

E-mail:

URL:

Comment:

Emoticon:

"A bad open-source software can be improved, not thrown away.

A closed-source one can only be sent to the trash."