Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Import sending emails?? 
 
United Media Associates
Member
 
Avatar
Total Posts:  48
Joined:  2008-03-27
 

Last night I tried some test imports with varying levels of success. With almost 10,000 customers to import, it made it through roughly 25% before locking up.

I quickly discovered that when importing customers, the import module seemed to be emailing each ‘new’ customer?!? Is the import triggering the email generation for new accounts? If so, is there a configuration setting I can use to disable emails for new accounts while importing customers?

I temporarily set my php config for sendmail script /dev/null to prevent sending emails, but this crashed the import script completely. Could the email function be somehow related to my import failing?

Any ideas?

 Signature 

United Media Associates, LLC.
Professional Magento Consulting and Systems Integration
_________________________________________________________
http://umassociates.com - Magento Silver Partner

 
Magento Community Magento Community
Magento Community
Magento Community
 
United Media Associates
Member
 
Avatar
Total Posts:  48
Joined:  2008-03-27
 

I tried doing a customer import… working off of a backup of the osCommerce database… and I went in an modified all the email addresses of the customer records in the database I was importing from, and since I had the same email address on all the customer records the script bombed after the first customer record it imported… but I did confirm that it tried sending an email to the address when running the import.

It looks like it fired off some kind of signup to the newsletter.

FromOwner [mailto:owner@example.com] 
Sent
MondayApril 282008 11:54 PM
To
Matt Johnson
Subject
Newsletter subscription success


Newsletter subscription success

Matt (mjohnsonperl)

 Signature 

United Media Associates, LLC.
Professional Magento Consulting and Systems Integration
_________________________________________________________
http://umassociates.com - Magento Silver Partner

 
Magento Community Magento Community
Magento Community
Magento Community
 
United Media Associates
Member
 
Avatar
Total Posts:  48
Joined:  2008-03-27
 

I decided to get a little more creative with overwriting the customer record email addresses in backup database that I was importing from.

I ran this query to overwrite all the customer email addresses in the customers and orders tables:

update customers
set customers_email_address 
concat(cast(customers_id as char(25)), '@example.com');

update orders
set customers_email_address 
concat(cast(customers_id as char(25)), '@example.com');

Please DO NOT run this query if you don’t know 100% what you are doing with SQL queries, and what the implications to the database is. It will overwrite all customer email addresses in the database it’s executed against, and you really don’t want to run it against an osCommerce database that’s in use.

Anyway, I ran this, then tried to do an import of the customers and orders… and it got through 100% of the 9930 customers, and it acted like it was moving on to import orders, but it didnt’ get a single order imported. There were a lot of bounced email messages because of the fake email addresses, but it made it through importing all of them.

I’m wondering if there is some kind of log or somewhere that might give me a clue why this thing just stops like it does in the middle of an import.

Matt (mjohnsonperl)

 Signature 

United Media Associates, LLC.
Professional Magento Consulting and Systems Integration
_________________________________________________________
http://umassociates.com - Magento Silver Partner

 
Magento Community Magento Community
Magento Community
Magento Community
 
United Media Associates
Member
 
Avatar
Total Posts:  48
Joined:  2008-03-27
 

I tried the new version (1.0.19700) on importing customers, and it looks like it’s still trying to send out emails because a bunch of postfix processes started up indicating it’s trying to send emails and getting bounced because I populated all the customers with fake email addresses.

 Signature 

United Media Associates, LLC.
Professional Magento Consulting and Systems Integration
_________________________________________________________
http://umassociates.com - Magento Silver Partner

 
Magento Community Magento Community
Magento Community
Magento Community
 
peterw83
Member
 
Total Posts:  44
Joined:  2007-11-12
 

Anyone know if disabling Mage_Newsletter from the admin if it will prevent the success emails from being sent after import?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Thierry S.
Member
 
Total Posts:  35
Joined:  2008-03-19
Paris
 

I think our problem is coming from the function _saveCustomer starting line 740 into app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php with line 773 into this file $customer->sendNewAccountEmail();

you can find sendNewAccountEmail into app/code/core/Mage/Customer/Model/Customer.php and that s basiclly sending email ...

The function _saveCustomer is being use into app/code/core/Model/Mysql4/Oscommerce.php into the function importCustomers starting line 350 without any lock regarding emails when importing ! smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
peterw83
Member
 
Total Posts:  44
Joined:  2007-11-12
 

So.... you think we can comment something out to solve this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Thierry S.
Member
 
Total Posts:  35
Joined:  2008-03-19
Paris
 
peterw83 - 07 May 2008 11:07 AM

So.... you think we can comment something out to solve this?

these changes have not been been tested and remember it should stay as a workaround to test oscommerce import tool and report bugs to Magento until they fix it !!
do not edit any files if you dont know what you’re doing !

for new account welcome email

comment out app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php line 773

$customer->sendNewAccountEmail();

becomes

// $customer->sendNewAccountEmail();

for the newsletter sucess email

comment out app/code/core/Mage/Newsletter/Model/Subscriber.php into subscribe function the if starting line 310

if (Mage::getStoreConfig(self::XML_PATH_CONFIRMATION_FLAG) == 1
                   
&& $this->getSubscriberStatus()==self::STATUS_NOT_ACTIVE{
                        $this
->sendConfirmationRequestEmail();
                
else {
                        $this
->sendConfirmationSuccessEmail();
                
}

becomes

/* if (Mage::getStoreConfig(self::XML_PATH_CONFIRMATION_FLAG) == 1
                   && $this->getSubscriberStatus()==self::STATUS_NOT_ACTIVE) {
                        $this->sendConfirmationRequestEmail();
                } else {
                        $this->sendConfirmationSuccessEmail();
                }*/

 
Magento Community Magento Community
Magento Community
Magento Community
 
ODB
Sr. Member
 
Avatar
Total Posts:  139
Joined:  2008-02-06
London
 
peterw83 - 07 May 2008 08:15 AM

Anyone know if disabling Mage_Newsletter from the admin if it will prevent the success emails from being sent after import?

Just tested, if you disable mage_newsletters a ‘subscription success’ email will still be sent to the subscriber if you add the email manually.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
53191 users|757 users currently online|107221 forum posts