<?php

namespace App\Notifications;


use App\Models\UserEmailVerification;
use Illuminate\Notifications\Messages\MailMessage;

class VerifyEmail extends AbstractEmail
{

    /** @var UserEmailVerification */
    private $attempt;

    /**
     * EmailVerificationRequest constructor.
     *
     * @param UserEmailVerification  $attempt
     */
    public function __construct(UserEmailVerification $attempt) {
        $this->attempt = $attempt;
    }

    public function toMail()
    {
        return (new MailMessage)
            ->subject('Email Verification Required')
            ->line('Please click the button below to verify your email address.')
            ->action('Verify Email Address', $this->verificationUrl()
            )
            ->line('If you did not create an account, no further action is required.');
    }

    private function verificationUrl(){
        return $this->attempt->token;
    }

}