Helper/EmailHelper.php
public function createMessageFromTemplateFile($template, $params, $subject, $recipient, $sender = null)
    {
        $body = $this->templating->render($template, $params);

        if (!$sender) {
            $sender = $this->defaultSender;
        }

        $message = new \Swift_Message();
        $message->setFrom($sender)
            ->setReplyTo($sender)
            ->setTo($recipient)
            ->setSubject($subject)
            ->setBody($body, 'text/html');
        return $message;
    }
public function createMessageFromTemplateFile($template, $params, $subject, $recipient, $sender = null)
    {
        $body = $this->templating->render($template, $params);

        if (!$sender) {
            $sender = $this->defaultSender;
        }

        $message = new \Swift_Message();
        $message->setFrom($sender)
            ->setReplyTo($sender)
            ->setTo($recipient)
            ->setSubject($subject)
            ->setBody($body, 'text/html');
        return $message;
    }
public function createMessageFromTemplateFile ( $ template , $ params , $ subject , $ recipient , $ sender = null ) { $ body = $ this -> templating -> render ( $ template , $ params ) ; if ( ! $ sender ) { $ sender = $ this -> defaultSender ; } $ message = new \ Swift_Message ( ) ; $ message -> setFrom ( $ sender ) -> setReplyTo ( $ sender ) -> setTo ( $ recipient ) -> setSubject ( $ subject ) -> setBody ( $ body , 'text/html' ) ; return $ message ; }
Create Message from a file-based template

@param string      $template
@param string      $params
@param string      $subject
@param string      $recipient
@param string|null $sender

@return \Swift_Message
Create Message from a file - based template