Enabled netmail test message
This commit is contained in:
50
app/Notifications/Channels/NetmailChannel.php
Normal file
50
app/Notifications/Channels/NetmailChannel.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notifications\Channels;
|
||||
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Models\Netmail;
|
||||
use App\Jobs\AddressPoll as Job;
|
||||
|
||||
class NetmailChannel
|
||||
{
|
||||
private const LOGKEY = 'CN-';
|
||||
|
||||
/**
|
||||
* The HTTP client instance.
|
||||
*
|
||||
* @var Netmail
|
||||
*/
|
||||
protected Netmail $netmail;
|
||||
|
||||
/**
|
||||
* Create a new Slack channel instance.
|
||||
*
|
||||
* @param Netmail $o
|
||||
*/
|
||||
public function __construct(Netmail $o)
|
||||
{
|
||||
$this->netmail = $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the given notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
* @param \Illuminate\Notifications\Notification $notification
|
||||
* @return \Psr\Http\Message\ResponseInterface|null
|
||||
*/
|
||||
public function send($notifiable,Notification $notification)
|
||||
{
|
||||
if (! $ao = $notifiable->routeNotificationFor('netmail',$notification))
|
||||
return;
|
||||
|
||||
$o = $notification->toNetmail($notifiable);
|
||||
Log::info(sprintf('%s:Test Netmail created [%s]',self::LOGKEY,$o->id));
|
||||
|
||||
Job::dispatch($ao);
|
||||
Log::info(sprintf('%s:Dispatched job to pool address [%s]',self::LOGKEY,$ao->ftn));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user