original_string: public function preview()
      {
          $inputs  = Input::all();
          $content = str_replace("&#39;", '"', $inputs['content']);
          $content = $this->variablesAdapter->get($content);
  
          if( isset($inputs['subject']) ) {
              $subject = str_replace("&#39;", '"', $inputs['subject']);
              $subject = $this->variablesAdapter->get($subject);
  
              array_set($inputs, 'subject', $subject);
          }
  
          preg_match_all('/\[\[(.*?)\]\]/', $content, $matches);
          $view = str_replace($matches[0], $matches[1], $content);
  
          if (array_get($inputs, 'type') === 'email') {
              event('antares.notifier.before_send_email', [&$view]);
          }
  
          $brandTemplate = BrandOptions::query()->where('brand_id', brand_id())->first();
          $header        = str_replace('</head>', '<style>' . $brandTemplate->styles . '</style></head>', $brandTemplate->header);
          $html          = preg_replace("/<body[^>]*>(.*?)<\/body>/is", '<body>' . $view . '</body>', $header . $brandTemplate->footer);
  
          array_set($inputs, 'content', $html);
  
          return $this->presenter->preview($inputs);
      }
code: public function preview()
      {
          $inputs  = Input::all();
          $content = str_replace("&#39;", '"', $inputs['content']);
          $content = $this->variablesAdapter->get($content);
  
          if( isset($inputs['subject']) ) {
              $subject = str_replace("&#39;", '"', $inputs['subject']);
              $subject = $this->variablesAdapter->get($subject);
  
              array_set($inputs, 'subject', $subject);
          }
  
          preg_match_all('/\[\[(.*?)\]\]/', $content, $matches);
          $view = str_replace($matches[0], $matches[1], $content);
  
          if (array_get($inputs, 'type') === 'email') {
              event('antares.notifier.before_send_email', [&$view]);
          }
  
          $brandTemplate = BrandOptions::query()->where('brand_id', brand_id())->first();
          $header        = str_replace('</head>', '<style>' . $brandTemplate->styles . '</style></head>', $brandTemplate->header);
          $html          = preg_replace("/<body[^>]*>(.*?)<\/body>/is", '<body>' . $view . '</body>', $header . $brandTemplate->footer);
  
          array_set($inputs, 'content', $html);
  
          return $this->presenter->preview($inputs);
      }
code_tokens: public function preview ( ) { $ inputs = Input :: all ( ) ; $ content = str_replace ( "&#39;" , '"' , $ inputs [ 'content' ] ) ; $ content = $ this -> variablesAdapter -> get ( $ content ) ; if ( isset ( $ inputs [ 'subject' ] ) ) { $ subject = str_replace ( "&#39;" , '"' , $ inputs [ 'subject' ] ) ; $ subject = $ this -> variablesAdapter -> get ( $ subject ) ; array_set ( $ inputs , 'subject' , $ subject ) ; } preg_match_all ( '/\[\[(.*?)\]\]/' , $ content , $ matches ) ; $ view = str_replace ( $ matches [ 0 ] , $ matches [ 1 ] , $ content ) ; if ( array_get ( $ inputs , 'type' ) === 'email' ) { event ( 'antares.notifier.before_send_email' , [ & $ view ] ) ; } $ brandTemplate = BrandOptions :: query ( ) -> where ( 'brand_id' , brand_id ( ) ) -> first ( ) ; $ header = str_replace ( '</head>' , '<style>' . $ brandTemplate -> styles . '</style></head>' , $ brandTemplate -> header ) ; $ html = preg_replace ( "/<body[^>]*>(.*?)<\/body>/is" , '<body>' . $ view . '</body>' , $ header . $ brandTemplate -> footer ) ; array_set ( $ inputs , 'content' , $ html ) ; return $ this -> presenter -> preview ( $ inputs ) ; }
docstring: preview notification notification
  
  @return View
docstring_tokens: preview notification notification