Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento 向特定组用户发送自动生成的密码_Magento - Fatal编程技术网

Magento 向特定组用户发送自动生成的密码

Magento 向特定组用户发送自动生成的密码,magento,Magento,我创建了一个名为公司用户的客户群,并向该群上传了大量电子邮件。现在我需要将自动生成的密码发送给公司用户用户组下的所有用户。该用户组的Id为“4” 到目前为止我试过 但这一次对我没用。有没有人经历过这样的问题 我们非常感谢任何解决方案 如果这不能直接起作用,那应该是一个开始 <?php ini_set('display_errors',true); include 'app/Mage.php'; Mage::setIsDeveloperMode(true); Mage::app(); $

我创建了一个名为
公司用户的
客户群
,并向该群上传了大量电子邮件。现在我需要将自动生成的密码发送给
公司用户
用户组下的所有用户。该用户组的Id为“4”

到目前为止我试过

但这一次对我没用。有没有人经历过这样的问题


我们非常感谢任何解决方案

如果这不能直接起作用,那应该是一个开始

<?php
ini_set('display_errors',true);
include 'app/Mage.php';
Mage::setIsDeveloperMode(true);

Mage::app();

$coll = Mage::getResourceModel('customer/customer_collection');
// or $coll = Mage::getModel('customer/customer')->getCollection();
/* @var $coll Mage_Customer_Model_Resource_Customer_Collection */
/* or Mage_Customer_Model_Entity_Customer_Collection < CE1.6 */
$coll->addFieldToFilter('group_id',4);

/*
 * Use the SPL IteratorAggregate implementation of Magento collections.
 * @var $customer Mage_Customer_Model_Customer
 * @see Mage_Adminhtml_CustomerController->saveAction()
 */
foreach ($coll as $customer) {
    $customer->setForceConfirmed(true);
    $sendPassToEmail = true;
    $customer->setPassword($customer->generatePassword());
    $customer->save();
    $customer->sendNewAccountEmail('registered', '', $customer->getStoreId());
}

如果这不能直接起作用,那应该是一个开始

<?php
ini_set('display_errors',true);
include 'app/Mage.php';
Mage::setIsDeveloperMode(true);

Mage::app();

$coll = Mage::getResourceModel('customer/customer_collection');
// or $coll = Mage::getModel('customer/customer')->getCollection();
/* @var $coll Mage_Customer_Model_Resource_Customer_Collection */
/* or Mage_Customer_Model_Entity_Customer_Collection < CE1.6 */
$coll->addFieldToFilter('group_id',4);

/*
 * Use the SPL IteratorAggregate implementation of Magento collections.
 * @var $customer Mage_Customer_Model_Customer
 * @see Mage_Adminhtml_CustomerController->saveAction()
 */
foreach ($coll as $customer) {
    $customer->setForceConfirmed(true);
    $sendPassToEmail = true;
    $customer->setPassword($customer->generatePassword());
    $customer->save();
    $customer->sendNewAccountEmail('registered', '', $customer->getStoreId());
}

你所说的“将大量电子邮件上传到该组”是什么意思?意思是我通过提供组id以csv格式上传了100多个联系人。然后我导出了该csv文件。现在所有新上传的用户都在我的名为“公司用户”的新联系人组下。现在我需要知道如何向这些用户发送自动生成的密码。你所说的“将批量电子邮件上载到该组”是什么意思?意思是我通过提供组id以csv格式上载了100多个联系人。然后我导出了该csv文件。现在所有新上传的用户都在我的名为“公司用户”的新联系人组下。现在我需要知道如何向这些用户发送自动生成的密码。我知道这会更新密码字段并触发mail->send.高兴听到这个消息。如果答案确实是一个解决方案,请将其标记为已接受,以便其他人可以找到。我知道这会更新密码字段并触发mail->send.高兴听到。如果答案实际上是一个解决方案,请将其标记为已接受,以便其他人可以找到它。