ldc-gen-game-web/app/Mail/WinningProof.php
2022-08-31 09:41:59 +02:00

49 lines
1.3 KiB
PHP

<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class WinningProof extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
private $sticker, $ticket, $barcode, $participation, $user, $settings;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($sticker, $ticket, $barcode, $participation, $user, $settings)
{
$this->sticker = $sticker;
$this->ticket = $ticket;
$this->barcode = $barcode;
$this->participation = $participation;
$this->user = $user;
$this->settings = $settings;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$participation = $this->participation;
$user = $this->user;
$settings = $this->settings;
return $this->subject(
$this->settings->name . " : Preuves de gain de " . $this->user->lastname . " " . $this->user->firstname
)->view(
'front.basic.winning-proof-email',
compact('participation', 'user', 'settings')
)->attach($this->sticker)->attach($this->ticket)->attach($this->barcode);
}
}