Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
I found a way out,
everything turned out to be painfully simple))
There were people in the howdy ho group who suggested what to do ...
Then google - as a result, profit
Need a token (I used a group token - done in the settings of the same group)
function уникальная_функция($id , $message)
{
$url = 'https://api.vk.com/method/messages.send';
$params = array(
'user_id' => $id = '266212779', // Кому отправляем, если взять вместо и вставить user_ids тогда можно будет добавлять id через запятую (сообщение будет отправляться 2х пользователям)
'message' => $message = '266212779', // Что отправляем
'access_token' => '0000000000000000000000000000', // access_token можно вбить хардкодом, если работа будет идти из под одного юзера
'v' => '5.37',
);
// В $result вернется id отправленного сообщения
$result = file_get_contents($url, false, stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query($params)
)
)));
}
add_action( 'woocommerce_new_order', 'уникальная_функция', 10, 5 );
$id , $message
can also attach your calls to calls, for example, the call to send a sticker (you can find out the ID of the sticker through the VK bot, and you can look at the call key in the documentation) , 10, 5 );
- function priority I woocommerce_order_status_pending_to_processing и woocommerce_order_status_pending_to_on-hold
with priority 7.5 (by authorization, order change has priority 10)'message' => $message = '
Сдесь какой то блочный код, по типу
__ ▂ ▃ ▅ ▇ █ 。◕‿ ◕。 █ ▇ ▅ ▃ ▂ __
', // Что отправляем
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question