-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
I've seen a few webhook questions on here before, but I'm sure the assumption here is a one app, one system approach. What I have is a notifications systems, whereby every customer on my platform needs to integrate Discord, so, the webhook will be different per user, and they'll set it on their profile.
How can I send a notification then to their webhook's url channel?
This is my current routing on my User
model to obtain their webhook:
/**
* Route notifications for the Discord channel.
*/
public function routeNotificationForDiscord($notification)
{
try {
$availableIntegration = AvailableIntegration::where('slug', 'discord')
->first();
$userIntegration = UserIntegration::where('user_id', $this->id)
->where('available_integration_id', $availableIntegration->id)
->first();
if (!$userIntegration) {
return null;
}
return $userIntegration->schema->discord_webhook;
} catch (\Exception $e) { }
return null;
}
Metadata
Metadata
Assignees
Labels
No labels