title = $title; $this->message = $message; $this->actionUrl = $actionUrl; $this->actionText = $actionText; $this->includeGreeting = $includeGreeting; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return ['mail']; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { $mail = (new MailMessage) ->subject($this->title) ->line($this->message); if ($this->includeGreeting) { $mail->greeting('Hello ' . $notifiable->name . '!'); } if ($this->actionUrl && $this->actionText) { $mail->action($this->actionText, $this->actionUrl); } $mail->line('Thank you for using DMR Bridge!'); return $mail; } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ public function toArray($notifiable) { return [ 'title' => $this->title, 'message' => $this->message, 'action_url' => $this->actionUrl, 'action_text' => $this->actionText, ]; } }