ldc-supportweb/app/Mail/TicketMention.php

48 lines
1 KiB
PHP
Raw Permalink Normal View History

2021-05-18 22:52:46 +02:00
<?php
namespace App\Mail;
use App\Lib\ToolboxHelper;
2021-05-18 22:52:46 +02:00
use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class TicketMention extends Mailable
{
use Queueable;
use SerializesModels;
2022-08-30 13:21:07 +00:00
/** @var \App\Models\Ticket */
2021-05-18 22:52:46 +02:00
private $ticket;
/** @var string */
private $corpsMaj;
/**
* Create a new message instance.
*
2022-08-30 13:21:07 +00:00
* @param \App\Models\Ticket $ticket
* @param string $corpsMaj
2021-05-18 22:52:46 +02:00
* @return void
*/
public function __construct(Ticket $ticket, string $corpsMaj)
{
2022-03-29 16:57:54 +02:00
$this->ticket = $ticket;
2021-05-18 22:52:46 +02:00
$this->corpsMaj = $corpsMaj;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
2022-03-29 16:57:54 +02:00
$ticket = $this->ticket;
$corpsMaj = ToolboxHelper::plainToHtml($this->corpsMaj);
2021-05-18 22:52:46 +02:00
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
}
}