我正在使用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变量吗?
答案 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);
.......
}
}