<?php

namespace App\Mail;

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

class PublicationMail extends Mailable
{
    use Queueable, SerializesModels;
    public $fromEmail;
    public $toEmail;
    public $name;
    public $mobile_number;
    public $company_name;
    public $book_type;
    public $genre;
    public $book_size;
    public $binding_type;
    public $no_of_pages;
    public $no_of_color_pages;
    public $no_of_copies;

 
    /**
     * Create a new message instance.
     *
     * @param string $fromEmail
     * @param string $toEmail
     */
    public function __construct($fromEmail, $toEmail, $name, $mobile_number,  $company_name, $book_type, $genre, $book_size, $binding_type, $no_of_pages, $no_of_color_pages, $no_of_copies)
    {
        $this->fromEmail = $fromEmail;
        $this->toEmail = $toEmail;
        $this->name = $name;
        $this->mobile_number = $mobile_number;
        // $this->weight = $weight;
        $this->company_name = $company_name;
        $this->book_type = $book_type;
        $this->genre = $genre;
        $this->book_size = $book_size;
        $this->binding_type = $binding_type;
        $this->no_of_pages = $no_of_pages;
        $this->no_of_color_pages = $no_of_color_pages;
        $this->no_of_copies = $no_of_copies;


    }
 
    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->from('your-email@example.com', $this->fromEmail)
                    ->subject('Publicaton Request')
                    ->view('emails.publicationmail')
                    ->with([
                        'fromEmail' => $this->fromEmail,
                        'toEmail' => $this->toEmail,
                        'name' => $this->name,
                        'mobile_number' => $this->mobile_number,
                        'company_name' => $this->company_name, // Add this line
                        'book_type' => $this->book_type, // Add this line
                        'genre' => $this->genre, // Add this line
                        'book_size' => $this->book_size, // Add this line
                        'binding_type' => $this->binding_type, // Add this line
                        'no_of_pages' => $this->no_of_pages, // Add this line
                        'no_of_color_pages' => $this->no_of_color_pages, // Add this line
                        'no_of_copies' => $this->no_of_copies, // Add this line
                    ]);
    }
}