Split out areafix command processing, implemented start of filefix
This commit is contained in:
@@ -16,7 +16,7 @@ class Help extends Netmails
|
||||
private const LOGKEY = 'ACH';
|
||||
|
||||
/**
|
||||
* Reply to a areafix, commands unknown.
|
||||
* Reply to an areafix HELP commands.
|
||||
*
|
||||
* @param Netmail $mo
|
||||
* @param Collection $commands
|
||||
|
63
app/Notifications/Netmails/Filefix/Help.php
Normal file
63
app/Notifications/Netmails/Filefix/Help.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notifications\Netmails\Filefix;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Notifications\Netmails;
|
||||
use App\Models\Netmail;
|
||||
use App\Traits\{MessagePath,PageTemplate};
|
||||
|
||||
class Help extends Netmails
|
||||
{
|
||||
use MessagePath,PageTemplate;
|
||||
|
||||
private const LOGKEY = 'FCH';
|
||||
|
||||
/**
|
||||
* Reply to a filefix HELP commands.
|
||||
*
|
||||
* @param Netmail $mo
|
||||
* @param Collection $commands
|
||||
*/
|
||||
public function __construct(private Netmail $mo,private Collection $commands)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
* @return Netmail
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function toNetmail(object $notifiable): Netmail
|
||||
{
|
||||
$o = $this->setupNetmail($notifiable);
|
||||
$ao = $notifiable->routeNotificationFor(static::via);
|
||||
|
||||
Log::info(sprintf('%s:+ Responding to filefix for a node [%s] HELP processed',self::LOGKEY,$ao->ftn));
|
||||
|
||||
$o->to = $this->mo->from;
|
||||
$o->replyid = $this->mo->msgid;
|
||||
$o->subject = 'Filefix - Help';
|
||||
|
||||
// Message
|
||||
$msg = $this->page(FALSE,'Filefix');
|
||||
|
||||
$msg->addText("Here are the list of commands available to you:\r\r\r\r");
|
||||
|
||||
foreach ($this->commands as $command) {
|
||||
$msg->addText("$command\r");
|
||||
}
|
||||
|
||||
$o->msg = $msg->render();
|
||||
$o->set_tagline = 'Why did the chicken cross the road? The robot programmed it.';
|
||||
|
||||
$o->save();
|
||||
|
||||
return $o;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user