Reputation: 325
Hi Developpers around the world!!!
I have just imported a new customer group of 700 Customers from a another CMS in Magento Eshop 1.7.02
So I need to sent to this Customer Group an email to inform them that they have a login with their email in my site but automatically to send them a new password using Magento build in function of Changing Current Password.
How programmatically can I sent an email with a new password to my new Customer Group (only to this group not all customers)?
Upvotes: 0
Views: 1452
Reputation: 15216
Here is a blog post that explains how to reset the passwords for all customers.
The main idea is to generate a new password, assign it to the customer model and then call sendNewAccountEmail
that sends the new password by e-mail.
The post explains how to reset the password for all customers but you can manipulate the customer collection to include only your customer group. Something like:
$customers = Mage::getModel('customer/customer')->getCollection();
$customers->addAttributeToFilter('group_id', YOUR GROUP ID HERE);
Upvotes: 2