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

42 lines
815 B
PHP
Raw Normal View History

2021-11-26 13:36:57 +00:00
<?php
namespace App\Console\Commands\Debug;
2021-11-26 13:36:57 +00:00
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Notification;
use App\Models\Address;
use App\Notifications\Netmails\Test as NetmailTestNotification;
2021-11-26 13:36:57 +00:00
class NetmailTest extends Command
2021-11-26 13:36:57 +00:00
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'debug:netmail:test'
2021-11-26 13:36:57 +00:00
.' {ftn : FTN to send netmail to}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Send a netmail test message';
/**
* Execute the console command.
*
* @return int
2021-11-26 13:36:57 +00:00
* @throws \Exception
*/
public function handle():int
2021-11-26 13:36:57 +00:00
{
$ao = Address::findFTN($this->argument('ftn'));
Notification::route('netmail',$ao)->notify(new NetmailTestNotification());
return self::SUCCESS;
2021-11-26 13:36:57 +00:00
}
}