【问题标题】:out of stock's notification mail is not working缺货通知电子邮件不起作用
【发布时间】:2015-04-30 07:00:40
【问题描述】:

我正在使用 magento 1.8.1,但我在通知电子邮件中收到缺货通知错误。我收到这种形式的邮件

 Hello Admin.'<br/>Customer'.wants to be notified when the below product is available in our inventory<br/><p>Item Name :</p><p>SKU :</p><p> Search Code :</p><p>Bar Code :</p>

没有任何关于产品的详细信息。

当我签入 \app\code\local\Adodis\Pincodecheck\controllers 时

代码是:

     $to = "sales@abcd.com";
     $subject = "Product in demand";
    $txt = "Hello Admin.'<br/>Customer'.".$pincode."wants to be notified when the below product is available in our inventory<br/><p>Item Name :".$name."</p><p>SKU :".$sku."</p><p> Search Code :".$scode."</p><p>Bar Code :".$bcode."</p>";


     mail($to,$subject,$txt);

你能告诉我在这段代码中需要修改什么以获得正确的邮件

【问题讨论】:

    标签: php magento magento-1.8 magento-1.9 magento-1.9.1


    【解决方案1】:

    添加这些标题并传递它:

    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    
    $to = "sales@abcd.com";
         $subject = "Product in demand";
        $txt = "Hello Admin.'<br />Customer'.".$pincode."wants to be notified when the below product is available in our inventory<br /><p>Item Name :".$name."</p><p>SKU :".$sku."</p><p> Search Code :".$scode."</p><p>Bar Code :".$bcode."</p>";
    
    
         mail($to,$subject,$txt, $headers);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-22
      • 2023-03-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多