Ayana Memon
Forum Replies Created
-
Hello, @gelieys
I checked this article,
This is only for admin role,
I wanted that when students will register then teacher get notification.
But ok, i done this functionality.
Thank You ??- This reply was modified 3 years ago by Ayana Memon.
No Any Reply from Support team ??
By the Way, I solved it by my self, using this code..write this code in functions.php file.
function registration_notification_teacher( $user_id, $args ) { $get_users = get_users(); foreach($get_users as $users): if($users->roles[0] == 'um_teacher'): $student_data = get_userdata($user_id); $teacher_id_student = get_user_meta($student_data->ID,'students_teacher',true); $teacher_id = $users->ID; if($teacher_id == $teacher_id_student): UM()->mail()->send( $email, 'notification_new_user', array( 'admin' => true ) ); UM()->mail()->send($users->user_email , 'notification_new_user', array( 'admin' => true )); endif; endif; // $user->roles[0]; //um_teacher endforeach; } add_action( 'um_registration_complete', 'registration_notification_teacher', 10, 2 );
- This reply was modified 3 years ago by Ayana Memon.
please help me @ultimatemembersupport to find solution
please help me @ultimatemembersupport to find solution..
hello @ultimatemembersupport
i used shortcodes for registration fields
country , city , university and department
now i want to edit this fields from my account..https://maus-reisen.de/staging/mause-staging/registrierung-neu/teacher-registration/
in this link i used shortcodes..
at the my_profile page fields are show same like registration page…
i want to edit this fields.- This reply was modified 3 years ago by Ayana Memon.
Hello @champsupertramp
I solved it by hook and ajax also..function approvement_from_teacher() { $student_id = $_POST['user_id']; um_fetch_user( $student_id ); UM()->user()->approve(); /*$student_status = get_user_meta($student_id,'account_status',true); $student_data = get_userdata($student_id); $email = ""; foreach($student_data as $student): $email = $student->user_email; endforeach; if($student_status == "awaiting_admin_review"): //update_user_meta( $student_id, 'account_status', 'approved'); UM()->user()->approve(); $subject = 'Account Activation'; $message = 'Your account is activated now'; wp_mail("shifamemon512@gmailcom",$subject,$message); else: echo $student_status; endif;*/ die(); } add_action( 'wp_ajax_approvement_from_teacher', 'approvement_from_teacher' ); add_action( 'wp_ajax_nopriv_approvement_from_teacher', 'approvement_from_teacher' ); add_action( 'um_post_registration_approved_hook', 'approvement_from_teacher', 10, 2 );
Thank You So Much ??
Hii @champsupertramp
i used this code in the database the status approved is changed but when i am login as a approved user then it shown me error …function approvement_from_teacher() { $student_id = $_POST['user_id']; $student_status = get_user_meta($student_id,'account_status',true); $student_data = get_userdata($student_id); $email = ""; foreach($student_data as $student): $email = $student->user_email; endforeach; if($student_status == "awaiting_admin_review"): update_user_meta( $student_id, 'account_status', 'approved'); $subject = 'Account Activation'; $message = 'Your account is activated now'; wp_mail($email,$subject,$message); else: echo $student_status; endif; die(); } add_action( 'wp_ajax_approvement_from_teacher', 'approvement_from_teacher' ); add_action( 'wp_ajax_nopriv_approvement_from_teacher', 'approvement_from_teacher' );
Error..
Your account has not yet been approved.- This reply was modified 3 years ago by Ayana Memon.
Hii @champsupertramp
not working ??Hii @champsupertramp
ok no problem, but when we click on approve button then account_status will be updated by approved, correct?
i am using ajax for updating the status,but now how i can send the mail to approval user that now he can login..
same like, when admin approve user account and user get mail..ajax function.
function approvement_from_teacher() { $student_id = $_POST['user_id']; $student_status = get_user_meta($student_id,'account_status',true); $student_data = get_userdata($student_id); $email = ""; foreach($student_data as $student): $email = $student->user_email; endforeach; if($student_status == "awaiting_admin_review"): update_user_meta( $student_id, 'account_status', 'approved'); else: echo $student_status; endif; die(); } add_action( 'wp_ajax_approvement_from_teacher', 'approvement_from_teacher' ); add_action( 'wp_ajax_nopriv_approvement_from_teacher', 'approvement_from_teacher' );
hello @champsupertramp
Thank You for Your Support,
now this is solve,
In the functions.php file some function name was conflicted, that’s why this problem was created.Hello @champsupertramp
i am using private browser.
i cleared cookies but same error,
what this error is occued for the plugin version?
i have a 2.2.5 version and new version is 2.3.0.Hii @champsupertramp ,
Great it’s solve.
Thank you so much dear @champsupertramp
?? ??- This reply was modified 3 years, 1 month ago by Ayana Memon.
Hii, @champsupertramp
this also isn’t working…
- This reply was modified 3 years, 1 month ago by Ayana Memon.
@champsupertramp
hii,
yet not working ??if ( UM()->fields()->is_error( 'teacher_country' ) ) { $html .= UM()->fields()->field_error( UM()->fields()->show_error( 'teacher_country' ), true ); }
- This reply was modified 3 years, 1 month ago by Ayana Memon.
@champsupertramp
hello,
but i almost complete this and it’s use in multiple place now at the end moment how i can change it?
if there have any option available with shortcode then please let me know..- This reply was modified 3 years, 1 month ago by Ayana Memon.