0

I have following code in my contoller called MessageController:

        $letter = $this->renderPartial('temp');
        $message=$letter;
        $mail = new YiiMailer('contact',array('message'=>$message,'name'=>'Message','description' => 'Message'));
        $mail->setSubject('Message');
        $mail->setFrom('anu.axmed@gmail.com', 'Company');
        $mail->setTo($_POST['useremail']);

Here temp is email template ($letter = $this->renderPartial('temp');). But, it is not loading email template. temp.php is located in message view folder. How can I impliment email template to my email?

phpdev
  • 511
  • 4
  • 22

1 Answers1

1

First of all I think you may need to set third parameter of renderPartial() to "true" $this->renderPartial('temp', null, true); so the rendering result will be returned not displayed.

ArtOsi
  • 913
  • 6
  • 13