clrghouz/app/Classes/FTN/Process/Echomail/Test.php

34 lines
866 B
PHP
Raw Normal View History

<?php
namespace App\Classes\FTN\Process\Echomail;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Log;
use App\Classes\FTN\{Message,Process};
use App\Notifications\Echomails\Test as TestNotification;
/**
* 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-';
private const testing = ['test','testing'];
public static function handle(Message $msg): bool
{
if ((strtolower($msg->user_to) !== 'all') || ! in_array(strtolower($msg->subject),self::testing))
return FALSE;
2023-07-29 03:17:59 +00:00
// @todo Need to limit this to areas defined in config.
2021-09-06 13:39:32 +00:00
Log::info(sprintf('%s:- Processing TEST message from (%s) [%s]',self::LOGKEY,$msg->user_from,$msg->fftn));
Notification::route('echomail',$msg->echoarea)->notify(new TestNotification($msg));
return TRUE;
}
}