<?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 ReviewerMail extends Mailable
{
    use Queueable, SerializesModels;

    public $fromEmail;
    public $toEmail;

    /**
     * Create a new message instance.
     *
     * @param string $fromEmail
     * @param string $toEmail
     */
    public function __construct($fromEmail, $toEmail)
    {
        $this->fromEmail = $fromEmail;
        $this->toEmail = $toEmail;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->from('your-email@example.com', $this->fromEmail,)
                    ->subject('Submiter Mail')
                    ->view('emails.reviewer')
                    ->with([
                        'fromEmail' => $this->fromEmail,
                        'toEmail' => $this->toEmail
                    ]);
    }
}
