← All changes
|
inc/emails/instructor/class-lp-email-enrolled-course-instructor.php
+57
-57
4.3.8
→
4.4.10
View file →
| @@ -1,57 +1,57 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * LP_Email_Enrolled_Course_Instructor. | |
| 4 | - * | |
| 5 | - * @author ThimPress | |
| 6 | - * @package Learnpress/Classes | |
| 7 | - * @extends LP_Email | |
| 8 | - * @version 3.0.1 | |
| 9 | - * @editor tungnx | |
| 10 | - * @modify 4.1.3 | |
| 11 | - */ | |
| 12 | - | |
| 13 | -/** | |
| 14 | - * Prevent loading this file directly | |
| 15 | - */ | |
| 16 | -defined( 'ABSPATH' ) || exit(); | |
| 17 | - | |
| 18 | -if ( ! class_exists( 'LP_Email_Enrolled_Course_Instructor' ) ) { | |
| 19 | - class LP_Email_Enrolled_Course_Instructor extends LP_Email_Type_Enrolled_Course { | |
| 20 | - /** | |
| 21 | - * LP_Email_Enrolled_Course_Instructor constructor. | |
| 22 | - */ | |
| 23 | - public function __construct() { | |
| 24 | - $this->id = 'enrolled-course-instructor'; | |
| 25 | - $this->title = __( 'Instructor', 'learnpress' ); | |
| 26 | - $this->description = __( 'Send this email to the instructor when they have enrolled in the course.', 'learnpress' ); | |
| 27 | - | |
| 28 | - $this->default_subject = __( '{{user_display_name}} has enrolled in the course', 'learnpress' ); | |
| 29 | - $this->default_heading = __( 'The user has enrolled in the course', 'learnpress' ); | |
| 30 | - | |
| 31 | - parent::__construct(); | |
| 32 | - } | |
| 33 | - | |
| 34 | - /** | |
| 35 | - * Trigger email. | |
| 36 | - * Receive 2 params: order_id, old_status | |
| 37 | - * | |
| 38 | - * @param array $params | |
| 39 | - * | |
| 40 | - * @throws Exception | |
| 41 | - * @since 4.1.1 | |
| 42 | - * @author tungnx | |
| 43 | - */ | |
| 44 | - public function handle( array $params ) { | |
| 45 | - if ( ! $this->check_and_set( $params ) ) { | |
| 46 | - return; | |
| 47 | - } | |
| 48 | - | |
| 49 | - $this->set_data_content(); | |
| 50 | - $this->set_receive( $this->_course->get_author()->get_email() ); | |
| 51 | - $this->send_email(); | |
| 52 | - } | |
| 53 | - } | |
| 54 | - | |
| 55 | - return new LP_Email_Enrolled_Course_Instructor(); | |
| 56 | -} | |
| 57 | - | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * LP_Email_Enrolled_Course_Instructor. | |
| 4 | + * | |
| 5 | + * @author ThimPress | |
| 6 | + * @package Learnpress/Classes | |
| 7 | + * @extends LP_Email | |
| 8 | + * @version 3.0.1 | |
| 9 | + * @editor tungnx | |
| 10 | + * @modify 4.1.3 | |
| 11 | + */ | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * Prevent loading this file directly | |
| 15 | + */ | |
| 16 | +defined( 'ABSPATH' ) || exit(); | |
| 17 | + | |
| 18 | +if ( ! class_exists( 'LP_Email_Enrolled_Course_Instructor' ) ) { | |
| 19 | + class LP_Email_Enrolled_Course_Instructor extends LP_Email_Type_Enrolled_Course { | |
| 20 | + /** | |
| 21 | + * LP_Email_Enrolled_Course_Instructor constructor. | |
| 22 | + */ | |
| 23 | + public function __construct() { | |
| 24 | + $this->id = 'enrolled-course-instructor'; | |
| 25 | + $this->title = __( 'Instructor', 'learnpress' ); | |
| 26 | + $this->description = __( 'Send this email to the instructor when they have enrolled in the course.', 'learnpress' ); | |
| 27 | + | |
| 28 | + $this->default_subject = __( '{{user_display_name}} has enrolled in the course', 'learnpress' ); | |
| 29 | + $this->default_heading = __( 'The user has enrolled in the course', 'learnpress' ); | |
| 30 | + | |
| 31 | + parent::__construct(); | |
| 32 | + } | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * Trigger email. | |
| 36 | + * Receive 2 params: order_id, old_status | |
| 37 | + * | |
| 38 | + * @param array $params | |
| 39 | + * | |
| 40 | + * @throws Exception | |
| 41 | + * @since 4.1.1 | |
| 42 | + * @author tungnx | |
| 43 | + */ | |
| 44 | + public function handle( array $params ) { | |
| 45 | + if ( ! $this->check_and_set( $params ) ) { | |
| 46 | + return; | |
| 47 | + } | |
| 48 | + | |
| 49 | + $this->set_data_content(); | |
| 50 | + $this->set_receive( $this->_course->get_author()->get_email() ); | |
| 51 | + $this->send_email(); | |
| 52 | + } | |
| 53 | + } | |
| 54 | + | |
| 55 | + return new LP_Email_Enrolled_Course_Instructor(); | |
| 56 | +} | |
| 57 | + | |