feat: send internal notification to discord
This commit is contained in:
@@ -29,6 +29,7 @@ class CleanupInstanceStuffsJob implements ShouldQueue, ShouldBeUnique
|
||||
try {
|
||||
$this->cleanup_waitlist();
|
||||
} catch (\Exception $e) {
|
||||
send_internal_notification('CleanupInstanceStuffsJob failed with error: ' . $e->getMessage());
|
||||
ray($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ class SendConfirmationForWaitlistJob implements ShouldQueue
|
||||
->html((string) $mail->render())
|
||||
);
|
||||
} catch (\Throwable $th) {
|
||||
send_internal_notification('SendConfirmationForWaitlistJob failed with error: ' . $th->getMessage());
|
||||
ray($th->getMessage());
|
||||
throw $th;
|
||||
}
|
||||
|
||||
27
app/Notifications/Internal/GeneralNotification.php
Normal file
27
app/Notifications/Internal/GeneralNotification.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notifications\Internal;
|
||||
|
||||
use App\Notifications\Channels\DiscordChannel;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
class GeneralNotification extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public function __construct(public string $message)
|
||||
{}
|
||||
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
$channels[] = DiscordChannel::class;
|
||||
return $channels;
|
||||
}
|
||||
|
||||
public function toDiscord(): string
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user