objToJson = $objToJson; $this->view = $view; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable): array { return ['mail']; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return MailMessage */ public function toMail($notifiable): MailMessage { $template = json_decode($this->objToJson); $view = $this->view ? $this->view : 'emails.test'; return (new MailMessage)->view( $view, ['objToJson' => $template] )->subject($template->title); } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ public function toArray($notifiable) { return [ // ]; } }