Answer the question
In order to leave comments, you need to log in
How to send a message from the site to Telegram with buttons?
Good afternoon, I want to figure out how to make a button in a Telegram message.
In general, the site has a button "Request a call", a popup opens with a form, there are inputs: Name , Phone they are processed in php and sent to the Cart.
I know about the reply_markup parameter, with which you can send the button, but it doesn't work. I tried everything, maybe I'm doing something wrong. If anyone has experienced this please let me know how you did it.
Send text like this:
$arr = array(
$nameFieldset => $call_name,
$phoneFieldset => $call_phone,
);
foreach($arr as $key => $value) {
$txt .= "<b>".$key."</b> ".$value."%0A";
};
$sendToTelegram = fopen("https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=html&text={$txt}","r");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question