<?php

namespace App\Mail;

use App\Model\ResetPassword;
use App\Model\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class ResetPasswordEmail extends Mailable
{
    use Queueable, SerializesModels;

    /**
     * Create a new message instance.
     *
     * @return void
     */

    protected $body;

    protected $post_message;

    protected $footer;

    protected $email;

    protected $url;


    public function __construct(ResetPassword $model,User $user)
    {
        $this->body = $model->body;
        $this->post_message = $model->postMessage;
        $this->footer = $model->footer;
        $this->email = $user->email;
        $this->full_name = $user->nombres;
        $this->url = action('Auth\ResetPasswordController@showResetForm',['token' => $model->token]);
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {

        return $this->subject('Prueba Mensaje')
            ->markdown('emails.resetpassword')
            ->with([
                "body" => $this->body,
                "token" => $this->body,
                "postMessage" => $this->post_message,
                "footer" => $this->body,
                "url" => $this->url,
                "full_name" => $this->full_name,
            ]);
    }
}
