Starts Notifications feature. Missing to send email with runtime configs.

This commit is contained in:
Joao Patricio committed 2023-05-19 18:01:56 +01:00
1 parent cd5655bd3f
commit 13fda50aac
16 files changed
+334 -35

No files matched your search

@@ -0,0 +1,25 @@
<?php
namespace App\Notifications\Channels;
use App\Jobs\SendMessageToDiscordJob;
use App\Models\InstanceSettings;
use Illuminate\Notifications\Notification;
class DiscordChannel
{
/**
* Send the given notification.
*/
public function send(object $notifiable, Notification $notification): void
{
$message = $notification->toDiscord($notifiable);
$webhookUrl = data_get(
InstanceSettings::get(),
'extra_attributes.discord_webhook'
);
dispatch(new SendMessageToDiscordJob($message, $webhookUrl));
}
}