<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class FinanceMail extends Mailable
{
    use Queueable, SerializesModels;

    public $user;
    public $currency;
    public $price;
    public $amount;
    public $tx_id;

    public function __construct($user, $currency, $price, $amount, $tx_id)
    {
        $this->user = $user;
        $this->currency = $currency;
        $this->price = $price;
        $this->amount = $amount;
        $this->tx_id = $tx_id;
    }

    public function build()
    {
        return $this->markdown('emails.finance', [
            'user' => $this->user,
            'price' => $this->price,
            'amount' => $this->amount,
            'currency' => $this->currency,
            'tx_id' => $this->tx_id,
        ])->subject('Funding Successful - Your Car Has Been Financed!');
    }
}
