<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Settings as mSetting;
use Cart;

class CheckoutMail extends Mailable
{
    use Queueable, SerializesModels;

    public $form_data;
    public $cart;

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

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
      $email = mSetting::where(['setting_name'=>'companyEmail'])->first()->setting_value;
      return $this->view('email.checkout-email')
                  ->from($email)
                  ->subject('Order Detail '.date('d/m/Y'));
    }
}
