Magento subscription question
-
I think there's a way to move the subscriptions to Subscribed status.
-
in construction
system(система)->configuration(конфигурация)->клиеты(customers)->newslatter(рассылка)->Параметры подписки(params newslater)->Необходимо подтвержение(requir apruve)
Make it important.нет(no)
English localizationization may not be confused by remembering.to activate all unenacted letters shell
$newsletterCollection = Mage::getModel('newsletter/subscriber')->getCollection(); // фильтруем коллекцию по тем чьи email не подтвержденны $newsletterCollection->addFieldToFilter('status',2);
foreach($newsletterCollection->load() as $_newsletter) {
$_newsletter->setStatus(1); // ставим статус подтверждён
$_newsletter->save(); // сохраняем подписчика
echo $_newsletter->getEmail().'[ok]'.PHP_EOL; // добавляем вывод
}
How do you write shell?
myshell.php
with contents
require_once 'abstract.php';
class My_Shell_MyShell extends Mage_Shell_Abstract
{
public function run()
{
if ($this->getArg('run')) {
$this->setStatus();
}
}public function setStatus() { // тут код который делает автоматическую подписку // представлен выше }
}
$shell = new My_Shell_MyShell();
$shell->run();
Crypt launch
- We'll go ssh to the server.
- Let's go to the file shell.
cd /path/to/mage/shell
- Let's start the violin team.
php -f myshell.php -- run