<?php

namespace App\Mail;

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

class MailableRecover extends Mailable
{
    use Queueable, SerializesModels;

    public $idUsuario;

    /**
     * Create a new message instance.
     *
     * @param int $idUsuario
     */
    public function __construct($idUsuario)
    {
        $this->idUsuario = $idUsuario;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        // Build the URL with port 4200
        $resetUrl = "http://192.168.100.48:4200/auth/changePassword?id={$this->idUsuario}";

        return $this->view('test')
            ->from(new Address('example@example.com', 'Plataforma Educativa'))
            ->subject('Cambio de Contraseña')
            ->with([
                'resetUrl' => $resetUrl,
            ]);
    }
}

