92 lines
2.1 KiB
PHP
92 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Models\Customer;
|
|
use App\Models\Participation;
|
|
use App\Models\Settings;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class WinningProofMail extends Mailable implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
use SerializesModels;
|
|
|
|
/** @var string */
|
|
private $stickerPath;
|
|
|
|
/** @var string */
|
|
private $ticketPath;
|
|
|
|
/** @var string */
|
|
private $barcodePath;
|
|
|
|
/**
|
|
* Participation
|
|
*
|
|
* @var Participation
|
|
*/
|
|
private $participation;
|
|
|
|
/**
|
|
* Customer
|
|
*
|
|
* @var Customer
|
|
*/
|
|
private $customer;
|
|
|
|
/**
|
|
* Settings
|
|
*
|
|
* @var Settings
|
|
*/
|
|
private $settings;
|
|
|
|
/**
|
|
* WinningProofMail
|
|
*
|
|
* @param string $stickerPath
|
|
* @param string $ticketPath
|
|
* @param string $barcodePath
|
|
* @param Participation $participation
|
|
* @param Customer $customer
|
|
* @param Settings $settings
|
|
*/
|
|
public function __construct(
|
|
string $stickerPath,
|
|
string $ticketPath,
|
|
string $barcodePath,
|
|
Participation $participation,
|
|
Customer $customer,
|
|
Settings $settings
|
|
) {
|
|
$this->stickerPath = $stickerPath;
|
|
$this->ticketPath = $ticketPath;
|
|
$this->barcodePath = $barcodePath;
|
|
$this->participation = $participation;
|
|
$this->customer = $customer;
|
|
$this->settings = $settings;
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function build()
|
|
{
|
|
$participation = $this->participation;
|
|
$customer = $this->customer;
|
|
return $this->subject(
|
|
$this->settings->name . " : Preuves de gain de " .
|
|
$customer->lastname . " " . $customer->firstname
|
|
)->view(
|
|
'front.basic.winning-proof-email',
|
|
compact('participation', 'customer')
|
|
)->attach($this->stickerPath)->attach($this->ticketPath)
|
|
->attach($this->barcodePath);
|
|
}
|
|
}
|