$ch=curl_init();
curl_setopt($ch, CURLOPT_URL,
'https://api.telegram.org/bot'.$token.'/sendMessage');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,
'chat_id='.$chat_id.'&text='.urlencode($text).'&parse_mode=html');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$result=curl_exec($ch);
curl_close($ch);
global $product;
$attachment_ids = $product->get_gallery_image_ids();
foreach ( $attachment_ids as $attachment_id ) {
$full_src = wp_get_attachment_image_src( $attachment_id, 'full' );
echo "<img src='" .full_src[0] ."'>
}