diff --git a/app/Notifications/QueueEmailDatabaseChannel.php b/app/Notifications/QueueEmailDatabaseChannel.php index b4ae877..df42d25 100644 --- a/app/Notifications/QueueEmailDatabaseChannel.php +++ b/app/Notifications/QueueEmailDatabaseChannel.php @@ -17,7 +17,7 @@ class QueueEmailDatabaseChannel extends EmailDatabaseWriterChannelBase public function send($notifiable, Notification $notification) { /** @var EmailLog $logEntry */ - $logEntry = $notification->toQueueEmailDatabase($notifiable); + $logEntry = $notification->toEmailDatabase($notifiable); $this->writeToTable($logEntry, true); } diff --git a/app/Notifications/ResetPassword.php b/app/Notifications/ResetPassword.php index 8a4e100..6109253 100644 --- a/app/Notifications/ResetPassword.php +++ b/app/Notifications/ResetPassword.php @@ -6,10 +6,7 @@ use App\Facade\UserConfig; use App\Mail\MailableBase; use App\Mail\ResetMyPassword; use Illuminate\Bus\Queueable; -use Illuminate\Mail\Mailable; use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; -use Illuminate\Notifications\Messages\MailMessage; class ResetPassword extends Notification { @@ -56,7 +53,7 @@ class ResetPassword extends Notification return $drivers; } - public function toQueueEmailDatabase($notifiable) + public function toEmailDatabase($notifiable) { return $this->toMail($notifiable)->buildEmailLog(); } diff --git a/app/Notifications/SentEmailDatabaseChannel.php b/app/Notifications/SentEmailDatabaseChannel.php index 851cb15..db63c19 100644 --- a/app/Notifications/SentEmailDatabaseChannel.php +++ b/app/Notifications/SentEmailDatabaseChannel.php @@ -17,7 +17,7 @@ class SentEmailDatabaseChannel extends EmailDatabaseWriterChannelBase public function send($notifiable, Notification $notification) { /** @var EmailLog $logEntry */ - $logEntry = $notification->toDatabaseWriter($notifiable); + $logEntry = $notification->toEmailDatabase($notifiable); $this->writeToTable($logEntry, false); } diff --git a/resources/systemd/blue-twilight-email.service b/resources/systemd/blue-twilight-email.service new file mode 100644 index 0000000..2e1d25b --- /dev/null +++ b/resources/systemd/blue-twilight-email.service @@ -0,0 +1,13 @@ +[Unit] +Description=Blue Twilight E-mail Queue Runner + +[Service] +WorkingDirectory=/data/www/blue-twilight.andysh.dev/ +ExecStart=/usr/bin/php artisan bt-queue:send-emails --poll +Restart=on-failure +User=www-data +Group=www-data +Environment=USER=www-data HOME=/var/www + +[Install] +WantedBy=multi-user.target \ No newline at end of file