N
N
Nikolai Vasin2020-05-05 15:34:37
In contact with
Nikolai Vasin, 2020-05-05 15:34:37

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

2 answer(s)
N
Nikolai Vasin, 2020-05-08
@talam0nal

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.

R
Roman Kulshin, 2020-05-07
@Gramor

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 question

Ask a Question

731 491 924 answers to any question