dsadsa123111 2015-07-07 23:19
浏览 19

以编程方式发送时,Magento新发货邮件空白

I have 2 servers running magento, one is the dev server and one is live.

I am sending shipment emails programatically after adding tracking information from an external source.

The email works fine using the code below on the dev server but the body of the email is blank on the live server even though the subject line is correct. When I send the email using the interface from the admin side, it works fine on the live server and the proper email goes through.

Any ideas why this might be happening ? Thank you

Here is the code

$shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipmentId);

if(!$shipment->getEmailSent())
{               
    $shipment->sendEmail();
    $shipment->setEmailSent(true);
    $shipment->save();                          
}

EDIT:

Upon viewing the exception.log file I found that the reason is

exception 'Zend_Controller_Response_Exception' with message 'Cannot send headers; headers already sent

This could be due to retrieving the tracking info by sending a POST request to an API. What could I do to resolve the headers issue ?

  • 写回答

1条回答 默认 最新

  • doucheng1063 2015-07-08 01:32
    关注

    Hopefully this helps anyone facing a similar problem. The issue was that I was outputting some text before calling the email sending block which was causing the error of headers not being sent.

    I removed the text and it worked fine.

    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度