Php Magento放弃购物车通知

Php Magento放弃购物车通知,php,magento,cron,Php,Magento,Cron,我正试图建立一个自动电子邮件通知放弃购物车,如果购物车是落后7天和不活动 我已在中添加了配置: app/code/core/Mage/Sales/etc/config.php <crontab> <jobs> <sales_clean_quotes> <schedule> <cron_expr>0 0 * * *</cron_expr>

我正试图建立一个自动电子邮件通知放弃购物车,如果购物车是落后7天和不活动

我已在中添加了配置: app/code/core/Mage/Sales/etc/config.php

<crontab>
    <jobs>
        <sales_clean_quotes>
            <schedule>
                <cron_expr>0 0 * * *</cron_expr>
            </schedule>
            <run>
                <model>sales/observer::cleanExpiredQuotes</model>
            </run>
        </sales_clean_quotes>
    <notify_abondoned_quotes>
        <schedule>
            <cron_expr>*/1 * * * *</cron_expr>
        </schedule>
        <run>
            <model>sales/observer::notifyAbondonedQuotes</model>
        </run>
    </notify_abondoned_quotes>

0 0 * * *
销售/观察员::cleanExpiredQuotes
*/1 * * * *
销售/观察员::NotifyAbondeQuotes
以及以下功能: app/code/core/Mage/Sales/Model/Observer.xml

    public function notifyAbondonedQuotes()
{

    Mage::dispatchEvent('clear_expired_quotes_before', array('sales_observer' => $this));

    $lifetimes = ['1'=>1];

    foreach ($lifetimes as $storeId=>$lifetime) {
        $lifetime *= 604800;

        // @var $quotes Mage_Sales_Model_Mysql4_Quote_Collection 
        $quotes = Mage::getModel('sales/quote')->getCollection();

        $quotes->addFieldToFilter('store_id', $storeId);
        $quotes->addFieldToFilter('updated_at', array('to'=>date("Y-m-d H:i:s",time()-$lifetime)));
        $quotes->addFieldToFilter('is_active', 0);
    $customer_email = $quote->getCustomerEmail();   

    # Authenticate with your API key
    $auth = array('api_key' => 'xxxxxxxxx);

    # The unique identifier for this smart email
    $smart_email_id = 'xxxx-6464-4d80-8ece-3d83c7bax12dd';

    # Create a new mailer and define your message
    $wrap = new CS_REST_Transactional_SmartEmail($smart_email_id, $auth);
    $message = array(
        "To" => $customer_email.'<'.customer_email.'>',
        "Data" => array(
        'x-apple-data-detectors' => 'x-apple-data-detectorsTestValue',
        'href^="tel"' => 'href^="tel"TestValue',
        'href^="sms"' => 'href^="sms"TestValue',
        'owa' => 'owaTestValue',
        ),
    );

    # Send the message and save the response
    $result = $wrap->send($message);
    }
    return $this;
}
公共函数notifyAbondeQuotes()
{
Mage::dispatchEvent('clear_expired_quotes_before',array('sales_observer'=>this');
$lifetimes=['1'=>1];
foreach($storeId=>$lifetime的生存期){
$LIFET*=604800;
//@var$quotes Mage_Sales_Model_Mysql4_Quote_Collection
$quotes=Mage::getModel('sales/quote')->getCollection();
$quotes->addFieldToFilter('store_id',$storeId);
$quotes->addFieldToFilter('updated_at',array('to'=>date('Y-m-d H:i:s',time()-$life));
$quotes->addFieldToFilter('is_active',0);
$customer_email=$quote->getCustomerEmail();
#使用API密钥进行身份验证
$auth=array('api_key'=>'xxxxxxxxx);
#此智能电子邮件的唯一标识符
$smart_email_id='xxxx-6464-4d80-8ece-3d83c7bax12dd';
#创建新邮件程序并定义您的邮件
$wrap=new CS\u REST\u Transactional\u SmartEmail($smart\u email\u id,$auth);
$message=数组(
“发送至“=>$customer\u email.”,
“数据”=>数组(
“x-apple-data-detectors'=>“x-apple-data-detectorsTestValue”,
'href^=“tel”=>'href^=“tel”TestValue',
'href^=“sms”=>'href^=“sms”测试值',
“owa'=>“owaTestValue”,
),
);
#发送消息并保存响应
$result=$wrap->send($message);
}
退还$this;
}
上述设置不起作用。请帮助