PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 All 140 releases
learnpress / inc / emails / student / class-lp-email-enrolled-course-user.php

class-lp-email-enrolled-course-user.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.9, at inc/emails/student/class-lp-email-enrolled-course-user.php

66 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * LP_Email_Enrolled_Course_User.
4 *
5 * @author ThimPress
6 * @package Learnpress/Classes
7 * @extends LP_Email
8 * @version 3.0.1
9 */
10
11 /**
12 * Prevent loading this file directly
13 */
14 defined( 'ABSPATH' ) || exit();
15
16 if ( ! class_exists( 'LP_Email_Enrolled_Course_User' ) ) {
17
18 /**
19 * Class LP_Email_Enrolled_Course_User
20 */
21 class LP_Email_Enrolled_Course_User extends LP_Email_Type_Enrolled_Course {
22 /**
23 * LP_Email_Enrolled_Course_User constructor.
24 */
25 public function __construct() {
26 $this->id = 'enrolled-course-user';
27 $this->title = __( 'User', 'learnpress' );
28 $this->description = __( 'Send this email to the user when they have enrolled in the course.', 'learnpress' );
29
30 $this->default_subject = __( '[{{site_title}}] You have enrolled in the course', 'learnpress' );
31 $this->default_heading = __( 'You have enrolled in the course', 'learnpress' );
32
33 parent::__construct();
34 }
35
36 /**
37 * Trigger email.
38 * Receive 2 params: order_id, old_status
39 *
40 * @param array $params
41 *
42 * @throws Exception
43 * @since 4.1.1
44 * @author tungnx
45 */
46 public function handle( array $params ) {
47 if ( ! $this->check_and_set( $params ) ) {
48 return;
49 }
50
51 $user_email = '';
52 if ( $this->_user ) {
53 $user_email = $this->_user->get_email();
54 } else {
55 $user_email = $this->_order->get_user_email();
56 }
57
58 $this->set_data_content();
59 $this->set_receive( $user_email );
60 $this->send_email();
61 }
62 }
63 }
64
65 return new LP_Email_Enrolled_Course_User();
66