<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Config;

use App\Models\Service;

class OrderRequestReject extends Mailable
{
    use Queueable, SerializesModels;

	public Service $service;
	public string $reason;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct(Service $o,string $reason)
    {
		$this->service = $o;
		$this->reason = $reason;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
		Config::set('site',$this->service->site);

		return $this
			->markdown('email.admin.order.reject')
			->subject(sprintf('Your order: #%s was rejected',$this->service->id))
			->with(['site'=>$this->service->site]);
    }
}