Vinai / customer-activation

Magento extension which makes it impossible for a customer to log in until the account has been activated by the administrator.
120 stars 59 forks source link

[Not issue - Question] - how to send notification using script? #83

Closed brazzil closed 9 years ago

brazzil commented 9 years ago

To activate the accounts I use the following script and works properly. How I can send the customer notification email using this script? thx

$customers = Mage::getResourceModel('customer/customer_collection')->addAttributeToSelect('*')->addAttributeToFilter('customer_activated', array('neq' => 1)); foreach($customers as $customer) { $customer->load($customer->getId()); $customer->setCustomerActivated(1); $customer->save(); };

Vinai commented 9 years ago

If you load the global events area in the script then it the regular event observer will be triggered and the emails sent automatically. However, if you prefer you can send the notification email to a customer using

Mage::helper('customeractivation')->sendCustomerNotificationEmail($customer);