<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class SendVerificationEmail extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'send:send_verification_email {--uri=} {--uri2=} {--uri3=}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Send Verification Email';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $subject = urldecode($this->option("uri"));
        $to =  urldecode($this->option("uri2"));
        $name = urldecode($this->option("uri3"));
        $email = $to;
        $mailbody = view('email_templates.accountverification', compact('name','email'))->render();
        send_email($to, $subject, $mailbody);
    }
}
