<?php

namespace App\Mail;

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

class DealerTopUpOtp extends Mailable
{
    use Queueable, SerializesModels;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($orgUser, $otp)
    {
        $this->orgUser = $orgUser; 
        $this->otp = $otp;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        // $orgUser = $this->orgUser;

        // return $this->view('view.name');
        return $this->from('target@example.com')
                    ->subject('Airtime Sales Portal OTP Code')
                    ->view('emails.dealer_topup_otp')
                    ->with('details', $this->orgUser)
                    ->with('otp', $this->otp);
    }
}
