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

No product at this time

Aktivní filtry

  • Nové
    • Nové
      • Nové
        12,30 €Cena
        No Product available
        • Nové
          12,30 €Cena
          • Nové
            25,62 €Cena
            No Product available
            • Nové
              25,62 €Cena
              • Nové
                25,62 €Cena
                No Product available
                • Nové
                  25,62 €Cena
                  • Nové
                    • Nové
                      16,40 €Cena
                      No Product available
                      • Nové
                        16,40 €Cena
                        • Nové
                          • Nové
                            • Nové
                              12,30 €Cena
                              No Product available
                              • Nové
                                12,30 €Cena
                                • Nové
                                  • Nové
                                    12,30 €Cena
                                    No Product available
                                    • Nové
                                      12,30 €Cena
                                      • Nové
                                        10,25 €Cena
                                        No Product available
                                        • Nové
                                          10,25 €Cena
                                          • Nové
                                            • Nové
                                              • Nové
                                                14,35 €Cena
                                                No Product available
                                                • Nové
                                                  14,35 €Cena
                                                  • Nové
                                                    22,55 €Cena
                                                    No Product available
                                                    • Nové
                                                      22,55 €Cena