从Symfony 1.4中检索模板

时间:2012-02-06 19:28:33

标签: php symfony-1.4

我正在使用symfony 1.4 w / propel

中的批处理脚本创建电子邮件

尝试将电子邮件正文设置为模板

player/emailSuccess.php

foreach ($players as $player) {

    if ($users->meetCriteria) {

        //send email from a template
        $email->setBody('player/emailSuccess.php');

    }
}

我可以在播放器模块中检索电子邮件操作并从批处理脚本中传递$ player变量吗?

1 个答案:

答案 0 :(得分:0)

试试这个。

 foreach ($players as $player) {

 if ($users->meetCriteria) {

    // use a partial to get the formatted email payload
    $html = $this->getPartial('my_partial', array('MyObject' => $MyObject));
    //send email from a template
    $email->setBody($html);
    .......
    }
 }