Home › Forums › Legacy Support › 4.0 Bugs & Issues › export e-mails
- This topic has 7 replies, 2 voices, and was last updated 3 years, 3 months ago by Veronica.
Viewing 8 posts - 1 through 8 (of 8 total)
-
AuthorPosts
-
August 3, 2021 at 6:00 pm #367062Zelimhan_46ParticipantI want to export the emails of students in a particular education. The solution in the link below does not work. https://wplms.io/support/knowledge-base/add-email-field-in-course-stats-to-download/ I will write the login information in the next message.August 3, 2021 at 6:00 pm #367063Zelimhan_46ParticipantThis reply has been marked as private.August 4, 2021 at 9:08 am #367094VeronicaModeratorhi try to use exactly this one:
change Identity number with your fieldadd_action('wplms_course_stats_process','process_custom_course_stat',10,8); add_filter('wplms_course_stats_list','add_custom_course_stat'); function add_custom_course_stat($list){ $new_list = array( 'Identity Number'=>'Identity Number' ); $list=array_merge($list,$new_list); return $list; } function process_custom_course_stat(&$csv_title, &$csv,&$i,&$course_id,&$user_id,&$field,&$ccsv,&$k){ if($field != 'Identity Number') // Ensures the field was checked. return; $title=__('Identity Number','wplms'); if(!in_array($title,$csv_title)) $csv_title[$k]=array('title'=>$title,'field'=>'Identity Number'); $ifield = 'Identity Number'; if(bp_is_active('xprofile')) $field_val= bp_get_profile_field_data( 'field='.$ifield.'&user_id=' .$user_id ); if(isset($field_val) && $field_val){ $csv[$i][]= $field_val; $ccsv[$i]['Identity Number'] = $field_val; }else{ $csv[$i][]= 'NA'; $ccsv[$i]['Identity Number'] = 'NA'; } }
August 4, 2021 at 10:37 am #367114Zelimhan_46ParticipantHey Veronica, How can i find Identity number? can you help me with this too?August 4, 2021 at 2:35 pm #367162Zelimhan_46ParticipantAlso, I guess there is no mail data in xprofile. It would be more correct to pull this mail data from wordpress's own system.August 5, 2021 at 10:30 am #367207VeronicaModeratorhi I said to change the Identity number with your field name like if you want to show email there then use this now:
also refer: https://wplms.io/support/forums/topic/student-registration-2/add_action('wplms_course_stats_process','process_custom_course_stat',10,8); add_filter('wplms_course_stats_list','add_custom_course_stat'); function add_custom_course_stat($list){ $new_list = array( 'email'=>'Email' //add another element like same above 'user_field3'=>'Gender' ); $list=array_merge($list,$new_list); return $list; } function process_custom_course_stat(&$csv_title, &$csv,&$i,&$course_id,&$user_id,&$field,&$ccsv,&$k){ if($field != 'email') // Ensures the field was checked. return; $title=__('Email','wplms'); if(!in_array($title,$csv_title)) $csv_title[$k]=array('title'=>$title,'field'=>'Email'); $ifield = 'Email'; $user = get_user_by('id',$user_id); $field_val = $user->data->user_email; if(isset($field_val) && $field_val){ $csv[$i][]= $field_val; $ccsv[$i]['Email'] = $field_val; }else{ $csv[$i][]= 'NA'; $ccsv[$i]['Email'] = 'NA'; } }
August 5, 2021 at 1:20 pm #367251Zelimhan_46Participantit's working. I love you, team!August 6, 2021 at 7:03 am #367286VeronicaModeratorHey, We aim to improve the usability of our customer’s web-sites and we are glad to have made a contribution. If you find our information to be helpful & you wouldn’t mind leaving a review, we would really appreciate that! Here: https://themeforest.net/item/wplms-learning-management-system/reviews/6780226 Thanks & Regards -
AuthorPosts
Viewing 8 posts - 1 through 8 (of 8 total)
- The topic ‘export e-mails’ is closed to new replies.