| @@ -88,8 +88,14 @@ | ||
| 88 | 88 | $this->emails['LP_Email_Cancelled_Order_Instructor'] = include_once 'emails/instructor/class-lp-email-cancelled-order-instructor.php'; |
| 89 | 89 | $this->emails['LP_Email_Cancelled_Order_User'] = include_once 'emails/student/class-lp-email-cancelled-order-user.php'; |
| 90 | 90 | $this->emails['LP_Email_Cancelled_Order_Guest'] = include_once 'emails/guest/class-lp-email-cancelled-order-guest.php'; |
| 91 | 91 | |
| 92 | + // Refunded order | |
| 93 | + $this->emails['LP_Email_Refunded_Order_Admin'] = include_once 'emails/admin/class-lp-email-refunded-order-admin.php'; | |
| 94 | + $this->emails['LP_Email_Refunded_Order_Instructor'] = include_once 'emails/instructor/class-lp-email-refunded-order-instructor.php'; | |
| 95 | + $this->emails['LP_Email_Refunded_Order_User'] = include_once 'emails/student/class-lp-email-refunded-order-user.php'; | |
| 96 | + $this->emails['LP_Email_Refund_Request_Order_Admin'] = include_once 'emails/admin/class-lp-email-refund-request-order-admin.php'; | |
| 97 | + | |
| 92 | 98 | // Enrolled course |
| 93 | 99 | $this->emails['LP_Email_Enrolled_Course_Admin'] = include_once 'emails/admin/class-lp-email-enrolled-course-admin.php'; |
| 94 | 100 | $this->emails['LP_Email_Enrolled_Course_Instructor'] = include_once 'emails/instructor/class-lp-email-enrolled-course-instructor.php'; |
| 95 | 101 | $this->emails['LP_Email_Enrolled_Course_User'] = include_once 'emails/student/class-lp-email-enrolled-course-user.php'; |
| @@ -109,108 +115,8 @@ | ||
| 109 | 115 | |
| 110 | 116 | do_action( 'learnpress/emails/register', $this->emails ); |
| 111 | 117 | } |
| 112 | 118 | |
| 113 | - | |
| 114 | - /** | |
| 115 | - * @version 1.0 | |
| 116 | - */ | |
| 117 | - public function __clone() { | |
| 118 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'learnpress' ), '1.0' ); | |
| 119 | - } | |
| 120 | - | |
| 121 | - /** | |
| 122 | - * @version 1.0 | |
| 123 | - */ | |
| 124 | - public function __wakeup() { | |
| 125 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'learnpress' ), '1.0' ); | |
| 126 | - } | |
| 127 | - | |
| 128 | - /** | |
| 129 | - * Init email notification hooks. | |
| 130 | - * | |
| 131 | - * @since 3.0.0 | |
| 132 | - * @editor tungnx | |
| 133 | - * @reason comment - not use | |
| 134 | - */ | |
| 135 | - /* | |
| 136 | - public static function init_email_notifications() { | |
| 137 | - self::instance(); | |
| 138 | - }*/ | |
| 139 | - | |
| 140 | - /** | |
| 141 | - * Push email notification into queue. | |
| 142 | - * | |
| 143 | - * @since 3.0.0 | |
| 144 | - */ | |
| 145 | - /* | |
| 146 | - public static function queue_email() { | |
| 147 | - $data_queue = array( | |
| 148 | - 'filter' => current_filter(), | |
| 149 | - 'args' => func_get_args(), | |
| 150 | - ); | |
| 151 | - LP()->background( 'emailer' )->push_to_queue( $data_queue ); | |
| 152 | - }*/ | |
| 153 | - | |
| 154 | - /** | |
| 155 | - * Send email notification. | |
| 156 | - * | |
| 157 | - * @editor tungnx | |
| 158 | - * @reason not use | |
| 159 | - * @deprecated 4.1.1 | |
| 160 | - */ | |
| 161 | - /* | |
| 162 | - public static function send_email() { | |
| 163 | - try { | |
| 164 | - $args = func_get_args(); | |
| 165 | - self::instance(); | |
| 166 | - do_action_ref_array( current_filter() . '/notification', $args ); | |
| 167 | - } catch ( Exception $e ) { | |
| 168 | - } | |
| 169 | - }*/ | |
| 170 | - | |
| 171 | - /** | |
| 172 | - * Email header. | |
| 173 | - * | |
| 174 | - * @param string $heading | |
| 175 | - * @param bool $echo | |
| 176 | - * | |
| 177 | - * @return string | |
| 178 | - * @editor tungnx | |
| 179 | - * @modify 4.1.4 comment - not used | |
| 180 | - */ | |
| 181 | - /*public function email_header( string $heading, bool $echo = true ): string { | |
| 182 | - ob_start(); | |
| 183 | - learn_press_get_template( 'emails/email-header.php', array( 'email_heading' => $heading ) ); | |
| 184 | - $header = ob_get_clean(); | |
| 185 | - if ( $echo ) { | |
| 186 | - echo $header; | |
| 187 | - } | |
| 188 | - | |
| 189 | - return $header; | |
| 190 | - }*/ | |
| 191 | - | |
| 192 | - /** | |
| 193 | - * Email footer. | |
| 194 | - * | |
| 195 | - * @param string $footer_text | |
| 196 | - * @param bool $echo | |
| 197 | - * | |
| 198 | - * @return string | |
| 199 | - * @editor tungnx | |
| 200 | - * @modify 4.1.4 comment - not used | |
| 201 | - */ | |
| 202 | - /*public function email_footer( string $footer_text, bool $echo = true ): string { | |
| 203 | - ob_start(); | |
| 204 | - learn_press_get_template( 'emails/email-footer.php', array( 'footer_text' => $footer_text ) ); | |
| 205 | - $footer = ob_get_clean(); | |
| 206 | - if ( $echo ) { | |
| 207 | - echo $footer; | |
| 208 | - } | |
| 209 | - | |
| 210 | - return $footer; | |
| 211 | - }*/ | |
| 212 | - | |
| 213 | 119 | public function set_current( $id ) { |
| 214 | 120 | $this->_last_current = $this->_current; |
| 215 | 121 | |
| 216 | 122 | if ( $id instanceof LP_Email ) { |
| @@ -238,9 +144,9 @@ | ||
| 238 | 144 | */ |
| 239 | 145 | public static function get_email( $id ) { |
| 240 | 146 | static $emails = array(); |
| 241 | 147 | |
| 242 | - if ( ! $emails || empty( $emails[ $id ] ) ) { | |
| 148 | + if ( empty( $emails[ $id ] ) ) { | |
| 243 | 149 | foreach ( self::instance()->emails as $class => $email ) { |
| 244 | 150 | $emails[ $email->id ] = $class; |
| 245 | 151 | } |
| 246 | 152 | } |