50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class YourMailableClass extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public $transactionId;
|
|
public $transactionDate;
|
|
public $quantity;
|
|
public $price;
|
|
public $totalAmount;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct($transactionId, $transactionDate, $quantity, $price, $totalAmount)
|
|
{
|
|
$this->transactionId = $transactionId;
|
|
$this->transactionDate = $transactionDate;
|
|
$this->quantity = $quantity;
|
|
$this->price = $price;
|
|
$this->totalAmount = $totalAmount;
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function build()
|
|
{
|
|
return $this->view('emails.transaction_notification')
|
|
->with([
|
|
'transactionId' => $this->transactionId,
|
|
'transactionDate' => $this->transactionDate,
|
|
'quantity' => $this->quantity,
|
|
'price' => $this->price,
|
|
'totalAmount' => $this->totalAmount,
|
|
]);
|
|
}
|
|
}
|