<?php

namespace App\Mail;

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

class ServletMail extends Mailable
{
    use Queueable, SerializesModels;
    
    public $ip;

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

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->to(Auth::user()->email)
            ->subject('Your myLEAP Account OTP - AryanIct.com')
            ->view('Mail.servlet')->with(['ip' => $this->ip]);

    }
}
