File: D:/HostingSpaces/ZelfVerkopen/zelfverkopen.nl/app/Mail/CreditInvoiceCreatedMail.php
<?php
namespace App\Mail;
use App\KommaApp\Customers\Models\Customer;
use App\KommaApp\Orders\Models\Order;
use App\KommaApp\Orders\OrderService;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class CreditInvoiceCreatedMail extends Mailable
{
use Queueable, SerializesModels;
protected $customer;
protected $order;
protected $invoicePath;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct(Customer $customer, Order $order, $invoicePath)
{
$this->customer = $customer;
$this->order = $order;
$this->invoicePath = $invoicePath;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->view('site.emails.client.creditInvoiceCreated')
->subject(trans('site/email.client.creditInvoiceCreated.subject'))
->to($this->customer->email)
->attach($this->invoicePath)
->with([
'genderId' => $this->customer->gender,
'lastName' => $this->customer->last_name,
'order' => $this->order
]);
}
}