ldc-supportweb/app/Mail/NewTicket.php

41 lines
792 B
PHP
Raw Normal View History

<?php
namespace App\Mail;
2022-08-30 13:21:07 +00:00
use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class NewTicket extends Mailable
{
2021-07-23 12:06:08 +02:00
use Queueable;
use SerializesModels;
2022-08-30 13:21:07 +00:00
/** @var \App\Models\Ticket */
private $ticket;
/**
* Create a new message instance.
*
2022-08-30 13:21:07 +00:00
* @param \App\Models\Ticket $ticket
* @return void
*/
2022-08-30 13:21:07 +00:00
public function __construct(Ticket $ticket)
{
$this->ticket = $ticket;
}
/**
* Build the message.
*
* @return $this
*/
public function build(): self
{
$ticket = $this->ticket;
return $this->subject("[Support] Nouveau ticket n°" . $ticket->id)
->view('emails.new-ticket', compact('ticket'));
}
}