Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //TELEGRAM NOTIFICTION
- //НАСТРОЙКИ
- $chatsId = [572821502]; //id пользователя кому отправлять сообщение
- $content = "ID: $offerId\nИмя: ".$order['name']."\nТелефон: ".$order['phone']; //Уведомление
- foreach ($chatsId as $chatId) {
- //не трогать далее
- $urlChat = 'https://api.telegram.org/bot871266550:AAGgFIZJ8sgQV8vrp8DPOgqqA451gPVFx3E/sendMessage?' . http_build_query(
- [
- 'chat_id' => $chatId,
- 'text' => $content,
- ]);
- $options = array(
- 'http' => array(
- 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
- 'method' => 'GET'
- )
- );
- $context = stream_context_create($options);
- file_get_contents($urlChat, false, $context);
- }
- //TELEGRAM NOTIFICTION
Advertisement
Add Comment
Please, Sign In to add comment