a. First note the Course ids of the courses you want to give access to the user. For example the course ids are : 1235,1127

Here's how you can do it :

1. Go to WP Admin -> Plugins -> Editor -> WPLMS Customizer -> wplms_customizer.php
2. Add the following code at the end of file :


 

add_action('bp_core_activated_user','add_user_to_courses');  
function add_user_to_courses(){
  $user_id = get_current_user_id();
 $courses = array(1235,1127);
 foreach($courses as $course){
  bp_course_add_user_to_course($user_id,$course);
 }
}