diff --git a/src/Channels/NexmoSmsChannel.php b/src/Channels/NexmoSmsChannel.php index b98b7d2..cc24d9c 100644 --- a/src/Channels/NexmoSmsChannel.php +++ b/src/Channels/NexmoSmsChannel.php @@ -54,13 +54,18 @@ public function send($notifiable, Notification $notification) $message = new NexmoMessage($message); } - return ($message->client ?? $this->nexmo)->message()->send([ + $payload = [ 'type' => $message->type, 'from' => $message->from ?: $this->from, 'to' => $to, 'text' => trim($message->content), 'client_ref' => $message->clientReference, - 'callback' => $message->statusCallback, - ]); + ]; + + if ($message->statusCallback) { + $payload['client_ref'] = $message->clientReference; + } + + return ($message->client ?? $this->nexmo)->message()->send($payload); } }