ldc-supportweb/app/Mail/TicketMention.php

46 lines
954 B
PHP
Raw Normal View History

2021-05-18 22:52:46 +02:00
<?php
namespace App\Mail;
use App\Lib\Utils;
use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class TicketMention extends Mailable
{
use Queueable;
use SerializesModels;
/** @var Ticket */
private $ticket;
/** @var string */
private $corpsMaj;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct(Ticket $ticket, string $corpsMaj)
{
$this->ticket = $ticket;
$this->corpsMaj = $corpsMaj;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$ticket = $this->ticket;
$corpsMaj = Utils::plainToHtml($this->corpsMaj);
return $this->subject("[SupportWeb] Vous avez été mentionné sur le ticket n° $ticket->id")
2021-05-21 14:22:50 +02:00
->view('emails.ticket-mention', compact('ticket', 'corpsMaj'));
2021-05-18 22:52:46 +02:00
}
}