Advertisement
alexx876

Untitled

Jun 1st, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. //TELEGRAM NOTIFICTION
  2. //НАСТРОЙКИ
  3. $chatsId = [572821502]; //id пользователя кому отправлять сообщение
  4. $content  = "ID: $offerId\nИмя: ".$order['name']."\nТелефон: ".$order['phone']; //Уведомление
  5.  
  6. foreach ($chatsId as $chatId)  {
  7.     //не трогать далее
  8.     $urlChat = 'https://api.telegram.org/bot871266550:AAGgFIZJ8sgQV8vrp8DPOgqqA451gPVFx3E/sendMessage?' . http_build_query(
  9.     [
  10.         'chat_id' => $chatId,
  11.         'text' => $content,
  12.     ]);
  13.            
  14.     $options = array(
  15.         'http' => array(
  16.             'header' => "Content-type: application/x-www-form-urlencoded\r\n",
  17.             'method' => 'GET'
  18.         )
  19.     );
  20.     $context = stream_context_create($options);
  21.     file_get_contents($urlChat, false, $context);
  22. }
  23. //TELEGRAM NOTIFICTION
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement