code: 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;
      }
docs: 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