Jump to content
Bicrypto v3.7.0 + All Plugins ×

The Billionaire

Members
  • Posts

    68
  • Reputation

    -1
  • Files

    0
  • Joined

  • Last visited

About The Billionaire

  • Birthday 05/02/1993

Recent Profile Visitors

496 profile views

The Billionaire's Achievements

Contributor

Contributor (5/14)

  • One Month Later
  • Week One Done
  • Dedicated Rare
  • Reacting Well
  • Collaborator Rare

Recent Badges

-1

Reputation

  1. public function whatsApp($numbers, $message) { // Replace these values with your actual data $apiKey = env('WHATSAPP_API_KEY'); $sender = env('WHATSAPP_API_SENDER'); $url = env('WHATSAPP_API_URL'); // If $numbers is not an array, convert it to an array if (!is_array($numbers)) { $numbers = [$numbers]; } foreach ($numbers as $number) { try { $response = Http::post($url, [ "api_key" => $apiKey, "sender" => $sender, "number" => $number, "message" => $message ]); // Handle response if ($response->successful()) { // Success $responseData = $response->json(); Log::info("WhatsApp message sent successfully" . json_encode($responseData)); // Process $responseData here } else { // Failure $errorCode = $response->status(); $errorMessage = $response->body(); Log::error("Failed to send WhatsApp message. Error code: $errorCode, Error message: $errorMessage"); // Handle error } } catch (\Exception $e) { Log::error("Exception occurred while sending WhatsApp message" . $e->getMessage()); // Handle exception } } } try this, change the environment to fit yours, this code can send messages to multiple numbers, 20 numbers at once using the API
  2. is it a shared host or dedicate server please can i come to your inbox let me explain what i am facing, i have succeeded to make it work but i have getting error base on how i am handling it
×
×
  • Create New...