Multiple enhancements to interactive messages, moved messages to Notifications, send netmail back when invalid packet password
This commit is contained in:
50
app/Notifications/Netmails/Test.php
Normal file
50
app/Notifications/Netmails/Test.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notifications\Netmails;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Notifications\Netmails;
|
||||
use App\Models\{Netmail,System};
|
||||
use App\Traits\PageTemplate;
|
||||
|
||||
class Test extends Netmails
|
||||
{
|
||||
use PageTemplate;
|
||||
|
||||
private const LOGKEY = 'NNT';
|
||||
|
||||
/**
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param System $so
|
||||
* @param mixed $notifiable
|
||||
* @return Netmail
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function toNetmail(System $so,object $notifiable): Netmail
|
||||
{
|
||||
$o = $this->setupNetmail($so,$notifiable);
|
||||
$ao = $notifiable->routeNotificationFor(static::via);
|
||||
|
||||
Log::info(sprintf('%s:+ Creating test netmail to [%s]',self::LOGKEY,$ao->ftn));
|
||||
|
||||
$o->subject = 'Testing 1, 2, 3...';
|
||||
|
||||
// Message
|
||||
$msg = $this->page(TRUE,'Test');
|
||||
|
||||
$msg->addText(
|
||||
"Hi there,\r\r".
|
||||
"This is just a test netmail to make sure we can send a message to your system.\r\r".
|
||||
"There is no need to reply, but if you do, it'll boost my spirits :)\r"
|
||||
);
|
||||
|
||||
$o->msg = $msg->render();
|
||||
$o->tagline = 'Testing, testing, 1 2 3.';
|
||||
|
||||
$o->save();
|
||||
|
||||
return $o;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user