2022-12-04 03:27:47 +00:00
|
|
|
<?php
|
|
|
|
|
2024-05-27 05:08:39 +00:00
|
|
|
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
|
|
|
|
*/
|
2024-05-27 05:08:39 +00:00
|
|
|
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.
|
|
|
|
*
|
2024-05-27 05:08:39 +00:00
|
|
|
* @return int
|
2022-12-04 03:27:47 +00:00
|
|
|
*/
|
2024-05-27 05:08:39 +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));
|
2024-05-27 05:08:39 +00:00
|
|
|
|
|
|
|
return self::SUCCESS;
|
2022-12-04 03:27:47 +00:00
|
|
|
}
|
|
|
|
}
|