ldc-boutique-cnc/app/Mail/RegisterConfirmMail.php
Jérémy Munsch f99e259bd5
Tons of fixes Refonte SYNC 1
- Authentification System OK
2022-11-16 12:47:41 +01:00

66 lines
1.5 KiB
PHP

<?php
namespace App\Mail;
use App\Models\Customer;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class RegisterConfirmMail extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* target Customer
*
* @var \App\Models\Customer
*/
private $customer;
/**
* The confirmation Url
*
* @var string
*/
private $confirmUrl;
/**
* Customer's firstname
*
* @var string
*/
private $firstname;
/**
* Create a new message instance.
*
* @param \App\Models\Customer $customer
* @param string $confirmUrl
* @param string $firstname
* @return void
*/
public function __construct(Customer $customer, string $confirmUrl, string $firstname)
{
$this->confirmUrl = $confirmUrl;
$this->firstname = $firstname;
$this->customer = $customer;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$confirmUrl = $this->confirmUrl;
$customer = $this->customer;
$firstname = $this->firstname;
return $this->subject("Confirmation d'inscription " . config('theme.site_name'))
->to($customer->email, $firstname)
->view('mails.register-ok', compact('customer', 'firstname', 'confirmUrl'));
}
}