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

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

View File

@@ -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));
}
}