clrghouz/app/Notifications/Netmails/Areafix/NotConfiguredHere.php
Deon George 1002309614
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 30s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m30s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s
Separatly handle areafix/filefix
2024-11-01 12:35:46 +11:00

64 lines
1.6 KiB
PHP

<?php
namespace App\Notifications\Netmails\Areafix;
use Illuminate\Support\Facades\Log;
use App\Notifications\Netmails;
use App\Models\Netmail;
use App\Traits\{MessagePath,PageTemplate};
class NotConfiguredHere extends Netmails
{
use MessagePath,PageTemplate;
private const LOGKEY = 'ANC';
private Netmail $mo;
/**
* Reply to a areafix, but the system isnt configured here.
*
* @param Netmail $mo
*/
public function __construct(Netmail $mo)
{
parent::__construct();
$this->mo = $mo;
}
/**
* 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 areafix for a node [%s] NOT CONFIGURED HERE',self::LOGKEY,$ao->ftn));
$o->to = $this->mo->from;
$o->replyid = $this->mo->msgid;
$o->subject = '*fix - Not Configured Here';
// Message
$msg = $this->page(FALSE,$this->mo->to);
$msg->addText("Your areafix request has been received, but unfortunately you are not configured here.\r\r");
$msg->addText(sprintf("If you want to receive mail from this system, please register/link your BBS via the web UI. Head over to %s. Feel free to netmail if you need help.\r\r",config('app.url')));
$msg->addText($this->message_path($this->mo));
$o->msg = $msg->render();
$o->set_tagline = 'Why did the robot cross the road? The chicken programmed it.';
$o->save();
return $o;
}
}