/**
  * Build the notification's view.
  *
  * @param  \Illuminate\Notifications\Messages\MailMessage  $message
  * @return void
  */
 protected function buildView($message)
 {
     if ($message->view) {
         return $message->view;
     }
     $markdown = call_user_func($this->markdownResolver);
     return ['html' => $markdown->render($message->markdown, $message->data()), 'text' => $markdown->renderText($message->markdown, $message->data())];
 }
Example #2
0
 private function prepareMail($notifiable)
 {
     $mail = new MailMessage();
     $data = ['recipient' => $notifiable];
     if ($title = $this->title($notifiable)) {
         $data['title'] = $title;
     }
     if ($this->subject) {
         $mail->subject($this->subject);
         $data['subject'] = $this->subject;
     }
     if (is_array($additionalData = $this->data($notifiable))) {
         foreach ($additionalData as $name => $value) {
             $data[$name] = $value;
         }
     }
     $mail->view($this->view, $data);
     return $mail;
 }