I’ve been asked today by one of the reader “How to subscribe a user to a community though a back-end”.
And here is the answer to the question:
There is a stored procedure that will do that for you. The name is [SPOC_COMMUNITIES_SUBSCRIBE] that takes Comminity_ID and USERID as parameters.
You can find Community_ID in table OC_COMMUNITIES and USERID is a username for that user.
This procedure just adds another record in table OC_COMMUNITYSUBSCRIPTIONS with USERID and Community_ID, also checks for duplicate.