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 (54)

No product at this time

Active filters

  • New
    €20.50Price
    No Product available
    • New
      €20.50Price
      • New
        • New
          €23.57Price
          No Product available
          • New
            €23.57Price
            • New
              €14.35Price
              No Product available
              • New
                €14.35Price
                • New
                  • New
                    €24.60Price
                    No Product available
                    • New
                      €24.60Price
                      • New
                        €23.57Price
                        No Product available
                        • New
                          €23.57Price
                          • New
                            €25.62Price
                            No Product available
                            • New
                              €25.62Price
                              • New
                                €25.62Price
                                No Product available
                                • New
                                  €25.62Price
                                  • New
                                    • New
                                      €22.55Price
                                      No Product available
                                      • New
                                        €22.55Price
                                        • New
                                          €20.50Price
                                          No Product available
                                          • New
                                            €20.50Price