original_string: protected function addContentToMailerInternal($message, $template, $data, $plainOnly = false)
      {
          /*
           * Start twig transaction
           */
          $this->startTwig();
  
          /*
           * Inject global view variables
           */
          $globalVars = ViewHelper::getGlobalVars();
          if (!empty($globalVars)) {
              $data = (array) $data + $globalVars;
          }
  
          /*
           * Subject
           */
          $swiftMessage = $message->getSwiftMessage();
  
          if (empty($swiftMessage->getSubject())) {
              $message->subject(Twig::parse($template->subject, $data));
          }
  
          $data += [
              'subject' => $swiftMessage->getSubject()
          ];
  
          if (!$plainOnly) {
              /*
               * HTML contents
               */
              $html = $this->renderTemplate($template, $data);
  
              $message->setBody($html, 'text/html');
          }
  
          /*
           * Text contents
           */
          $text = $this->renderTextTemplate($template, $data);
  
          $message->addPart($text, 'text/plain');
  
          /*
           * End twig transaction
           */
          $this->stopTwig();
      }
code: protected function addContentToMailerInternal($message, $template, $data, $plainOnly = false)
      {
          /*
           * Start twig transaction
           */
          $this->startTwig();
  
          /*
           * Inject global view variables
           */
          $globalVars = ViewHelper::getGlobalVars();
          if (!empty($globalVars)) {
              $data = (array) $data + $globalVars;
          }
  
          /*
           * Subject
           */
          $swiftMessage = $message->getSwiftMessage();
  
          if (empty($swiftMessage->getSubject())) {
              $message->subject(Twig::parse($template->subject, $data));
          }
  
          $data += [
              'subject' => $swiftMessage->getSubject()
          ];
  
          if (!$plainOnly) {
              /*
               * HTML contents
               */
              $html = $this->renderTemplate($template, $data);
  
              $message->setBody($html, 'text/html');
          }
  
          /*
           * Text contents
           */
          $text = $this->renderTextTemplate($template, $data);
  
          $message->addPart($text, 'text/plain');
  
          /*
           * End twig transaction
           */
          $this->stopTwig();
      }
code_tokens: protected function addContentToMailerInternal ( $ message , $ template , $ data , $ plainOnly = false ) { /*
           * Start twig transaction
           */ $ this -> startTwig ( ) ; /*
           * Inject global view variables
           */ $ globalVars = ViewHelper :: getGlobalVars ( ) ; if ( ! empty ( $ globalVars ) ) { $ data = ( array ) $ data + $ globalVars ; } /*
           * Subject
           */ $ swiftMessage = $ message -> getSwiftMessage ( ) ; if ( empty ( $ swiftMessage -> getSubject ( ) ) ) { $ message -> subject ( Twig :: parse ( $ template -> subject , $ data ) ) ; } $ data += [ 'subject' => $ swiftMessage -> getSubject ( ) ] ; if ( ! $ plainOnly ) { /*
               * HTML contents
               */ $ html = $ this -> renderTemplate ( $ template , $ data ) ; $ message -> setBody ( $ html , 'text/html' ) ; } /*
           * Text contents
           */ $ text = $ this -> renderTextTemplate ( $ template , $ data ) ; $ message -> addPart ( $ text , 'text/plain' ) ; /*
           * End twig transaction
           */ $ this -> stopTwig ( ) ; }
docstring: Internal method used to share logic between `addRawContentToMailer` and `addContentToMailer`
  
  @param \Illuminate\Mail\Message $message
  @param string $template
  @param array $data
  @param bool $plainOnly Add only plain text content to the message
  @return void
docstring_tokens: Internal method used to share logic between addRawContentToMailer and addContentToMailer