<?php

namespace BYDAuto\Notifications;

use BYDAuto\Models\Testdrive;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class TestdirveNotification extends Notification
{
    use Queueable;

    public function __construct(protected Testdrive $model)
    {
        //
    }

    public function via(object $notifiable): array
    {
        return ['mail'];
    }

    public function toMail(object $notifiable): MailMessage
    {
        return (new MailMessage)
            ->subject("预约试驾线索通知")
            ->line("收到了一条新的试驾预约信息，请及时处理")
            ->line("姓名：" . $this->model->name . " \n电话：" . $this->model->mobile)
            ->line("=====")
            ->line("祝，工作愉快！");
    }

    public function toArray(object $notifiable): array
    {
        return [
            //
        ];
    }
}
