2021-07-30 14:35:52 +00:00
|
|
|
<?php
|
|
|
|
|
2021-09-12 12:14:04 +00:00
|
|
|
namespace App\Classes\FTN\Process\Echomail;
|
2021-07-30 14:35:52 +00:00
|
|
|
|
2023-07-23 07:27:52 +00:00
|
|
|
use Illuminate\Support\Facades\Notification;
|
2021-07-30 14:35:52 +00:00
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
|
|
use App\Classes\FTN\{Message,Process};
|
2023-07-23 07:27:52 +00:00
|
|
|
use App\Notifications\Echomails\Test as TestNotification;
|
2021-07-30 14:35:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Process messages to Test
|
|
|
|
*
|
|
|
|
* @package App\Classes\FTN\Process
|
|
|
|
*/
|
|
|
|
final class Test extends Process
|
|
|
|
{
|
2021-09-06 13:39:32 +00:00
|
|
|
private const LOGKEY = 'RT-';
|
|
|
|
|
2021-07-30 14:35:52 +00:00
|
|
|
private const testing = ['test','testing'];
|
|
|
|
|
|
|
|
public static function handle(Message $msg): bool
|
|
|
|
{
|
2023-09-12 07:20:09 +00:00
|
|
|
if (! self::canProcess($msg->echoarea)
|
|
|
|
|| (strtolower($msg->user_to) !== 'all')
|
|
|
|
|| (! in_array(strtolower($msg->subject),self::testing)))
|
2021-07-30 14:35:52 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2023-09-12 07:20:09 +00:00
|
|
|
Log::info(sprintf('%s:- Processing TEST message from (%s) [%s] in [%s]',self::LOGKEY,$msg->user_from,$msg->fftn,$msg->echoarea));
|
2021-07-30 14:35:52 +00:00
|
|
|
|
2023-07-23 07:27:52 +00:00
|
|
|
Notification::route('echomail',$msg->echoarea)->notify(new TestNotification($msg));
|
2021-07-30 14:35:52 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|