Multiple enhancements to interactive messages, moved messages to Notifications, send netmail back when invalid packet password
This commit is contained in:
47
app/Notifications/Channels/EchomailChannel.php
Normal file
47
app/Notifications/Channels/EchomailChannel.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notifications\Channels;
|
||||
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Models\Echomail;
|
||||
use App\Models\Setup;
|
||||
|
||||
class EchomailChannel
|
||||
{
|
||||
private const LOGKEY = 'CN-';
|
||||
|
||||
/**
|
||||
* @var Echomail
|
||||
*/
|
||||
protected Echomail $echomail;
|
||||
|
||||
/**
|
||||
* Create a new Netmail channel instance.
|
||||
*
|
||||
* @param Echomail $o
|
||||
*/
|
||||
public function __construct(Echomail $o)
|
||||
{
|
||||
$this->echomail = $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the given notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
* @param \Illuminate\Notifications\Notification $notification
|
||||
* @return \Psr\Http\Message\ResponseInterface|void
|
||||
*/
|
||||
public function send($notifiable,Notification $notification)
|
||||
{
|
||||
if (! $echoarea = $notifiable->routeNotificationFor('echomail',$notification))
|
||||
return;
|
||||
|
||||
$so = Setup::findOrFail(config('app.id'))->system;
|
||||
$o = $notification->toEchomail($so,$notifiable);
|
||||
|
||||
Log::info(sprintf('%s:= Posted echomail [%s] to [%s]',self::LOGKEY,$o->msgid,$echoarea));
|
||||
}
|
||||
}
|
@@ -5,22 +5,21 @@ namespace App\Notifications\Channels;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Models\Netmail;
|
||||
use App\Jobs\AddressPoll as Job;
|
||||
use App\Models\Netmail;
|
||||
use App\Models\Setup;
|
||||
|
||||
class NetmailChannel
|
||||
{
|
||||
private const LOGKEY = 'CN-';
|
||||
|
||||
/**
|
||||
* The HTTP client instance.
|
||||
*
|
||||
* @var Netmail
|
||||
*/
|
||||
protected Netmail $netmail;
|
||||
|
||||
/**
|
||||
* Create a new Slack channel instance.
|
||||
* Create a new Netmail channel instance.
|
||||
*
|
||||
* @param Netmail $o
|
||||
*/
|
||||
@@ -41,9 +40,10 @@ class NetmailChannel
|
||||
if (! $ao = $notifiable->routeNotificationFor('netmail',$notification))
|
||||
return;
|
||||
|
||||
$o = $notification->toNetmail($notifiable);
|
||||
$so = Setup::findOrFail(config('app.id'))->system;
|
||||
$o = $notification->toNetmail($so,$notifiable);
|
||||
|
||||
Job::dispatch($ao);
|
||||
Log::info(sprintf('%s:Sent netmail [%s] via [%s]',self::LOGKEY,$o->msgid,$ao->ftn));
|
||||
Log::info(sprintf('%s:= Sent netmail [%s] to [%s]',self::LOGKEY,$o->msgid,$ao->ftn));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user