public function sendSms($phone, $message, $countryId) { $logFile = _PS_ROOT_DIR_ . '/var/logs/smsinvoice.log'; // Cesta k log súboru $country = new Country($countryId); $connection = new ConnectionStream(/*application_id: */ 31089, /*application_token:*/ 'sGRmOB1sNza22Ryu8IhoUrresrwtbjBJJeKGM4R5Zcg1aSGqll'); $sender = new MessageSender($connection); $number_checker = new NumberChecker($connection); // Kontrola telefónneho čísla cez BulkGate API try { $check = $number_checker->check([$phone], $country->iso_code); } catch (Exception $e) { file_put_contents($logFile, "[ERROR] NumberChecker failed: " . $e->getMessage() . "\n", FILE_APPEND); $check = []; } // Ak kontrola čísla prebehla úspešne if (isset($check[$phone]) && $check[$phone]['valid']) { $phone = $check[$phone]['phone_number']; } else { file_put_contents($logFile, "[WARNING] Invalid phone number: $phone\n", FILE_APPEND); // Ak nie je platné číslo, pokračujeme bez kontroly } // Pripravenie SMS $smsMessage = new Sms($phone, $message); // Odoslanie SMS try { $response = $sender->send($smsMessage); } catch (Exception $e) { file_put_contents($logFile, "[ERROR] BulkGate API failed: " . $e->getMessage() . "\n", FILE_APPEND); return false; } // Logovanie odpovede API file_put_contents($logFile, "[INFO] BulkGate API Response: " . json_encode($response) . "\n", FILE_APPEND); // Overenie odpovede if ($response->status == 'accepted') { return true; } else { file_put_contents($logFile, "[ERROR] SMS failed, response: " . json_encode($response) . "\n", FILE_APPEND); return false; } } Live predaj (249)

No product at this time

Active filters

  • New
    • New
      • New
        €16.40Price
        No Product available
        • New
          €16.40Price
          • New
            • New
              €12.30Price
              No Product available
              • New
                €12.30Price
                • New
                  €35.87Price
                  No Product available
                  • New
                    €35.87Price
                    • New
                      €12.30Price
                      No Product available
                      • New
                        €12.30Price
                        • New
                          • New
                            • New
                              €12.30Price
                              No Product available
                              • New
                                €12.30Price
                                • New
                                  €35.87Price
                                  No Product available
                                  • New
                                    €35.87Price
                                    • New
                                      €35.87Price
                                      No Product available
                                      • New
                                        €35.87Price
                                        • New
                                          • New
                                            • New
                                              €12.30Price
                                              No Product available
                                              • New
                                                €12.30Price