Coursepress Pro, how do I view invites I sent?

I sent a bunch of invites through the CoursePress Pro plugin. How do I view/confirm that the invites were sent, and to what email address?

  • Vinod Dalvi
    • WP Unicorn

    Hi Stacy,

    Welcome to the WPMU Dev community and thank you for your question.

    When invitation gets sent successfully then you will see the message "Invitation successfully sent." and you will see list of all the persons to whom you have sent invitation as displayed in the attached screenshot.

    Please advise if you have more questions.

    Kind Regards,
    Vinod Dalvi

  • Stacy
    • Flash Drive

    I should have been more specific... I meant when I invite Students to the course. A small box shows at the top of the screen when I hit send that says "your invitation was successfully sent" but only until you add another student or otherwise navigate away from the page. I sent out invites to the course on Sunday, and I need to go back and verify who they were sent to.

  • Vinod Dalvi
    • WP Unicorn

    Hi Stacy,

    Thank you for your specific reply.

    Currently there isn't any plugin option to track invitations sent to the students but you can get copy of sent student invitation email on the admin email id of your site by adding the following code in the functions.php file of your child theme so that you can track the sent student invitation emails.

    function student_invite_mail() {
    	if ( class_exists('CoursePress_Capabilities') && isset($_POST['invite_student']) ) {
    		check_admin_referer('student_invitation');
    		$course_id = ( int ) $_GET['course_id'];
    		$course = new Course($course_id);
    		if ( CoursePress_Capabilities::can_assign_course_student($course_id) ) {
    			if ( is_email($_POST['email']) ) {
    		        $email_args['course_id'] = $course_id;
    		        $email_args['student_first_name'] = $_POST['first_name'];
    		        $email_args['student_last_name'] = $_POST['last_name'];
    		        $email_args['student_email'] = $_POST['email'];
    		        $email_args['enroll_type'] = $course->details->enroll_type;
    
    		        global $course_slug;
    
    				$email_address = $email_args[ 'student_email' ];
    
    				if ( isset( $email_args[ 'course_id' ] ) ) {
    					$course = new Course( $email_args[ 'course_id' ] );
    				}
    
    				$tags			 = array( 'STUDENT_FIRST_NAME', 'STUDENT_LAST_NAME', 'COURSE_NAME', 'COURSE_EXCERPT', 'COURSE_ADDRESS', 'WEBSITE_ADDRESS', 'PASSCODE' );
    				$tags_replaces	 = array( $email_args[ 'student_first_name' ], $email_args[ 'student_last_name' ], $course->details->post_title, $course->details->post_excerpt, $course->get_permalink(), home_url(), $course->details->passcode );
    
    				if ( $email_args[ 'enroll_type' ] == 'passcode' ) {
    					$message = coursepress_get_invitation_content_passcode_email();
    					$subject = coursepress_get_invitation_passcode_email_subject();
    				} else {
    					$message = coursepress_get_invitation_content_email();
    					$subject = coursepress_get_invitation_email_subject();
    				}
    
    				$message = str_replace( $tags, $tags_replaces, $message );
    
    				add_filter( 'wp_mail_from', 'my_passcode_from_function' );
    
    				if ( !function_exists( 'my_passcode_from_function' ) ) {
    
    					function my_passcode_from_function( $email ) {
    						return coursepress_get_invitation_passcode_from_email();
    					}
    
    				}
    
    				add_filter( 'wp_mail_from_name', 'my_passcode_from_name_function' );
    
    				if ( !function_exists( 'my_passcode_from_name_function' ) ) {
    
    					function my_passcode_from_name_function( $name ) {
    						return coursepress_get_invitation_passcode_from_name();
    					}
    
    				}
    				add_filter( 'wp_mail_content_type', 'cp_email_set_content_type' );
    
    				if ( !function_exists( 'cp_email_set_content_type' ) ) {
    
    					function cp_email_set_content_type( $content_type ) {
    						return 'text/html';
    					}
    
    				}
    
    				add_filter( 'wp_mail_charset', 'cp_set_charset' );
    
    				if ( !function_exists( 'cp_set_charset' ) ) {
    
    					function cp_set_charset( $charset ) {
    						return get_option( 'blog_charset' );
    					}
    
    				}
    				$admin_email = get_option( 'admin_email' );
    				wp_mail( $admin_email, stripslashes( $subject." - Student Email ID : ". $email_address ), stripslashes( nl2br( $message ) ) );
    
    			}
    		}
    	}
    }
    add_action( 'admin_init', 'student_invite_mail' );

    Best Regards,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.