token = $token; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { $drivers = []; if (UserConfig::get('queue_emails')) { $drivers[] = QueueEmailDatabaseChannel::class; } else { $drivers[] = 'mail'; $drivers[] = SentEmailDatabaseChannel::class; } return $drivers; } public function toEmailDatabase($notifiable) { return $this->toMail($notifiable)->buildEmailLog(); } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage|MailableBase */ public function toMail($notifiable) { $notification = new ResetMyPassword($notifiable, $this->token); // Set to and from properties accordingly $notification->from(UserConfig::get('sender_address'), UserConfig::get('sender_name')); $notification->to($notifiable->email, $notifiable->name); return $notification; } }