67 lines
1.6 KiB
PHP
67 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Models\Reduction;
|
|
use App\Models\Settings;
|
|
use App\Models\User;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class ReductionWon extends Mailable implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
use SerializesModels;
|
|
|
|
/** @var \App\Models\Customer */
|
|
private $user;
|
|
|
|
/** @var mixed */
|
|
private $coupon;
|
|
|
|
/** @var \App\Models\Settings */
|
|
private $settings;
|
|
|
|
/** @var \App\Models\Reduction */
|
|
private $crmCoupon;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @param \App\Models\User $user
|
|
* @param mixed $coupon
|
|
* @param \App\Models\Settings $settings
|
|
* @param \App\Models\Reduction $crmCoupon
|
|
* @return void
|
|
*/
|
|
public function __construct(User $user, mixed $coupon, Settings $settings, Reduction $crmCoupon)
|
|
{
|
|
$this->user = $user;
|
|
$this->coupon = $coupon;
|
|
$this->settings = $settings;
|
|
$this->crmCoupon = $crmCoupon;
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function build()
|
|
{
|
|
return $this->subject(sprintf(
|
|
'%s, n\'attendez plus pour imprimer votre bon d\'achat %s !',
|
|
$this->user->firstname,
|
|
$this->settings->name
|
|
))
|
|
->view('front.basic.reduction-mail')
|
|
->with([
|
|
'user' => $this->user,
|
|
'coupon' => $this->coupon,
|
|
'settings' => $this->settings,
|
|
'crmCoupon' => $this->crmCoupon
|
|
]);
|
|
}
|
|
}
|