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
|
|
|
|
{
|
|
|
|
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));
|
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;
|
|
|
|
}
|
|
|
|
}
|