2019-07-14 12:13:58 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Notifications;
|
|
|
|
|
|
|
|
use App\EmailLog;
|
|
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
|
|
|
|
class SentEmailDatabaseChannel extends EmailDatabaseWriterChannelBase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Send the given notification.
|
|
|
|
*
|
|
|
|
* @param mixed $notifiable
|
|
|
|
* @param \Illuminate\Notifications\Notification $notification
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function send($notifiable, Notification $notification)
|
|
|
|
{
|
|
|
|
/** @var EmailLog $logEntry */
|
2019-07-14 12:29:25 +01:00
|
|
|
$logEntry = $notification->toEmailDatabase($notifiable);
|
2019-07-14 12:13:58 +01:00
|
|
|
|
|
|
|
$this->writeToTable($logEntry, false);
|
|
|
|
}
|
|
|
|
}
|