3 posts / 0 new
Last post
dashmasterful
Offline
Last seen: 1 year 2 months ago
Joined: 06/27/2018
Automatically subscribe all users to a course when they register

Upon registration, I want to automatically subscribe all users to a single course that I have created. Can someone please point me in the right direct?

James Aparicio
James Aparicio's picture
Offline
Last seen: 1 week 4 days ago
Staff
Joined: 10/30/2013
Hi dashmasterful,

Hi dashmasterful,

 

Pretty simple.

Simply implement the hook_user_insert and then add subscribe the user with the og_group function

og_group("node", COURSE_NID, array('entity_type' => 'user', 'entity' => USER_UID));

 

Best regards

dashmasterful
Offline
Last seen: 1 year 2 months ago
Joined: 06/27/2018
Thanks!

Thanks. I'll give that a go and see what happens.