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; } } Új termékek

No product at this time

Aktív szűrők

  • Új
    • Új
      16,00 €Ár
      No Product available
      • Új
        16,00 €Ár
        • Új
          • Új
            12,00 €Ár
            No Product available
            • Új
              12,00 €Ár
              • Új
                5,00 €Ár
                No Product available
                • Új
                  5,00 €Ár
                  • Új
                    • Új
                      • Új
                        16,00 €Ár
                        No Product available
                        • Új
                          16,00 €Ár
                          • Új
                            • Új
                              16,00 €Ár
                              No Product available
                              • Új
                                16,00 €Ár
                                • Új
                                  • Új
                                    16,00 €Ár
                                    No Product available
                                    • Új
                                      16,00 €Ár
                                      • Új
                                        • Új
                                          16,00 €Ár
                                          No Product available
                                          • Új
                                            16,00 €Ár
                                            • Új
                                              • Új
                                                • Új
                                                  16,00 €Ár
                                                  No Product available
                                                  • Új
                                                    16,00 €Ár