56 lines
1.3 KiB
PHP
56 lines
1.3 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 ReductionWon extends Mailable implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
use SerializesModels;
|
|
|
|
/**
|
|
* Customer
|
|
*
|
|
* @var Customer
|
|
*/
|
|
private $customer;
|
|
|
|
private $coupon,
|
|
private $settings,
|
|
private $crmCoupon;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct(Customer $customer, $coupon, $settings, $crmCoupon)
|
|
{
|
|
$this->customer = $customer;
|
|
$this->coupon = $coupon;
|
|
$this->settings = $settings;
|
|
$this->crmCoupon = $crmCoupon;
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function build()
|
|
{
|
|
return $this->subject($this->customer->firstname . ", n'attendez plus pour imprimer votre bon d'achat " .
|
|
$this->settings->name . " !")->view('front.basic.reduction-mail')
|
|
->with([
|
|
'customer' => $this->customer,
|
|
'coupon' => $this->coupon,
|
|
'settings' => $this->settings,
|
|
'crmCoupon' => $this->crmCoupon
|
|
]);
|
|
}
|
|
}
|