clrghouz/app/Console/Commands/Debug/SendTestEmail.php

41 lines
681 B
PHP
Raw Permalink Normal View History

2022-12-04 03:27:47 +00:00
<?php
namespace App\Console\Commands\Debug;
2022-12-04 03:27:47 +00:00
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Mail;
use App\Mail\TestEmail as MailTest;
use App\Models\User;
class SendTestEmail extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'debug:email:test {id}';
2022-12-04 03:27:47 +00:00
/**
* The console command description.
*
* @var string
*/
protected $description = 'Send a test email';
/**
* Execute the console command.
*
* @return int
2022-12-04 03:27:47 +00:00
*/
public function handle(): int
2022-12-04 03:27:47 +00:00
{
$uo = User::find($this->argument('id'));
Mail::to($uo->email)
->send(new MailTest($uo));
return self::SUCCESS;
2022-12-04 03:27:47 +00:00
}
}