update api register
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Services\Notification\Adapters;
|
||||
|
||||
use App\Models\NotificationDelivery;
|
||||
use App\Services\Notification\Contracts\NotificationChannelAdapter;
|
||||
use App\Services\Notification\WhapiIdService;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
@@ -12,6 +13,11 @@ class WhatsAppUnofficialAdapter implements NotificationChannelAdapter
|
||||
public function send(NotificationDelivery $delivery): array
|
||||
{
|
||||
$config = $delivery->channelConfig;
|
||||
if ($config?->provider === 'whapi_id') {
|
||||
$response = app(WhapiIdService::class)->send($config, $delivery->destination, $delivery->rendered_body);
|
||||
|
||||
return ['provider_message_id' => data_get($response, 'results.id_message'), 'response' => $response];
|
||||
}
|
||||
$credentials = $config?->credentials ?? [];
|
||||
$settings = $config?->settings ?? [];
|
||||
$url = $settings['send_url'] ?? null;
|
||||
|
||||
Reference in New Issue
Block a user