Sending e-mails and settings on Team.

This commit is contained in:
Joao Patricio
2023-05-25 17:27:52 +01:00
parent aea6bced69
commit f23a760aac
23 changed files with 344 additions and 267 deletions

View File

@@ -3,7 +3,6 @@
namespace App\Notifications\Channels;
use App\Jobs\SendMessageToDiscordJob;
use App\Models\InstanceSettings;
use Illuminate\Notifications\Notification;
class DiscordChannel
@@ -11,14 +10,11 @@ class DiscordChannel
/**
* Send the given notification.
*/
public function send(object $notifiable, Notification $notification): void
public function send(SendsDiscord $notifiable, Notification $notification): void
{
$message = $notification->toDiscord($notifiable);
$webhookUrl = data_get(
InstanceSettings::get(),
'extra_attributes.discord_webhook'
);
$webhookUrl = $notifiable->routeNotificationForDiscord();
dispatch(new SendMessageToDiscordJob($message, $webhookUrl));
}