<?php

namespace Sargilla\Flatlab4\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

class PasswordResetNotification extends Notification
{
    use Queueable;

     /**
     * The password reset token.
     *
     * @var string
     */
    public $token;

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

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)
            ->subject('Reseteo de contraseña de tu cuenta.')
            ->greeting("Hola, $notifiable->name")
            ->line('Estás recibiendo este correo porque entendemos que deseas resetear la contraseña de tu cuenta.')
            ->action('Resetear Contraseña', route('password.reset', $this->token))
            ->line('Si no pidio modificar su contraseña, no debe hacer nada.');
    }

}
