Answer the question
In order to leave comments, you need to log in
How to organize a newsletter on behalf of the community in VK?
The contact has an embedded button on the site "Receive notifications". If the user pressed this button, then he can receive messages from the community. How to use the API to send messages to everyone who pressed this button?
Answer the question
In order to leave comments, you need to log in
https://vk.com/dev/widget_allow_messages_from_comm...
The widget returns the widgets.allowMessagesFromCommunity.allowed event.
You process the event using VK.Observer and pass the id of the user who granted the permission to your backend and write the id to the database.
Then you send messages from the backend using the https://vk.com/dev/messages.send method, specifying the id of the users you want to send messages to.
Through the groups.getMembers method, we pull out a list of all community members, then in messages.send in the user_ids parameter we pass this entire list, it will be sent to everyone who has access
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question