2017-03-06 7 views
0

내가 MessageController라는 내 콘트롤 코드를 다음 있습니다 : 여기 tempyii 1에서 전자 메일 템플릿을 전자 메일로 보내는 방법은 무엇입니까?

 $letter = $this->renderPartial('temp'); 
     $message=$letter; 
     $mail = new YiiMailer('contact',array('message'=>$message,'name'=>'Message','description' => 'Message')); 
     $mail->setSubject('Message'); 
     $mail->setFrom('[email protected]', 'Company'); 
     $mail->setTo($_POST['useremail']); 

이메일 템플릿 ($letter = $this->renderPartial('temp');)입니다. 하지만 이메일 템플릿을로드하지 않습니다. temp.phpmessage 뷰 폴더에 있습니다. 이메일 템플릿을 내 이메일에 삽입하려면 어떻게해야합니까?

답변

1

우선, renderPartial()의 세 번째 매개 변수를 "true"로 설정해야한다고 생각합니다. $this->renderPartial('temp', null, true); 렌더링 결과가 표시되지 않습니다.