/** * EnrollUserToCourse. * php version 5.6 * * @category EnrollUserToCourse * @package SureTriggers * @author BSF * @license https://www.gnu.org/licenses/gpl-3.0.html GPLv3 * @link https://www.brainstormforce.com/ * @since 1.0.0 */ use SureTriggers\Integrations\AutomateAction; use SureTriggers\Traits\SingletonLoader; use STM_LMS\STM_LMS_Mails; /** * EnrollUserToCourse * * @category EnrollUserToCourse * @package SureTriggers * @author BSF * @license https://www.gnu.org/licenses/gpl-3.0.html GPLv3 * @link https://www.brainstormforce.com/ * @since 1.0.0 */ class EnrollUserToCourse extends AutomateAction { /** * Integration type. * * @var string */ public $integration = 'MasterStudyLms'; /** * Action name. * * @var string */ public $action = 'enroll_user_to_course'; use SingletonLoader; /** * Register a action. * * @param array $actions actions. * @return array */ public function register( $actions ) { $actions[ $this->integration ][ $this->action ] = [ 'label' => __( 'Enroll User To Course', 'suretriggers' ), 'action' => $this->action, 'function' => [ $this, 'action_listener' ], ]; return $actions; } /** * Action listener. * * @param int $user_id user_id. * @param int $automation_id automation_id. * @param array $fields fields. * @param array $selected_options selectedOptions. * @psalm-suppress UndefinedMethod * @throws Exception Exception. * * @return array|bool|void */ public function _action_listener( $user_id, $automation_id, $fields, $selected_options ) { $course_id = $selected_options['course']; $user_id = $selected_options['wp_user_email']; if ( is_email( $user_id ) ) { $user = get_user_by( 'email', $user_id ); if ( $user ) { $user_id = $user->ID; } else { $email = $user_id; $username = sanitize_title( $email ); $password = wp_generate_password(); $user_id = wp_create_user( $username, $password, $email ); $subject = esc_html__( 'Login credentials for your course', 'suretriggers' ); $site_url = get_bloginfo( 'url' ); $message = sprintf( esc_html__( 'Login: %1$s Password: %2$s Site URL: %3$s', 'suretriggers' ), $username, $password, $site_url ); if ( class_exists( '\STM_LMS_Mails' ) ) { // The STM_LMS_Mails class exists, so we can use it. \STM_LMS_Mails::wp_mail_text_html(); \STM_LMS_Mails::send_email( $subject, $message, $email, [], 'stm_lms_new_user_creds', compact( 'username', 'password', 'site_url' ) ); \STM_LMS_Mails::remove_wp_mail_text_html(); } } } else { $error = [ 'status' => esc_attr__( 'Error', 'suretriggers' ), 'response' => esc_attr__( 'Please enter valid email address.', 'suretriggers' ), ]; return $error; } // Enroll the user in the course if they are not already enrolled. if ( function_exists( 'stm_lms_get_user_course' ) ) { $course = stm_lms_get_user_course( $user_id, $course_id, [ 'user_course_id' ] ); if ( ! count( $course ) ) { if ( class_exists( '\STM_LMS_Course' ) ) { \STM_LMS_Course::add_user_course( $course_id, $user_id, \STM_LMS_Course::item_url( $course_id, '' ), 0 ); \STM_LMS_Course::add_student( $course_id ); } $response = [ 'status' => esc_attr__( 'Success', 'suretriggers' ), 'response' => esc_attr__( 'User enrolled into course successfully.', 'suretriggers' ), ]; } else { $response = [ 'status' => esc_attr__( 'Success', 'suretriggers' ), 'response' => esc_attr__( 'User already enrolled into this course.', 'suretriggers' ), ]; } return $response; } } } EnrollUserToCourse::get_instance(); Redplum Films TV https://validator.w3.org/feed/docs/rss2.html Our favorite PayPal Casinos 2026 Ranking Upgrade Onlayn Kazino Pin Up – Azrbaycanda Giri v Qeydiyyat.4310 Book of Ra Magic Gebührenfrei Aufführen Protestation ohne rise of dead freie Spins Registration Online Spielbank dragon lady Slot RTP Freispiele bloß Einzahlung 2026 How Canadian Individual Defense Efforts Safeguards Online Gamblers Greatest Neteller Casinos United kingdom inside the 2026: Casinos Acknowledging Neteller Freispiele bloß Einzahlung Dritter monat des jahres queen of queens Casino 2026 100 Freispiele bloß Einzahlung: Top the emperors tomb Slot Angebote 2026 30 Freispiele Herr Wette bei 70 kostenlose Spins ohne Einzahlung: Kostenfrei Casino Free Spins Ideal Neosurf Casinos April 2026 Ranked & Analyzed Most useful multi-words casinos: recreation for everyone Kasino Maklercourtage bloß Einzahlung 2026 Neue journey of the sun Slot Gebührenfrei Codes Minimal Deposit Gambling enterprises United kingdom Best Lower-Risk Web sites 2026 Book of Ra tricks Sizzling Hot Deluxe Erreichbar Echtgeld Slot + 30 Freispiele Tag für tag ! Quick Withdrawal Casinos inside the April 2026: Greatest Same date Withdrawal Websites Quickest Payout Online casinos & Instantaneous Withdrawals Internet sites 2026 Would it be courtroom and you can safer to try out on the web sites roulette the real deal money? Klassischer book of ra manipulieren handy Sonnennächster planet Slot Enjoy render Put ten, Choice 10, Score 100 100 percent free Revolves toward Large Bass Splash Casino Mostbet Azrbaycan.2477 Casino pharaos riches Paypal 25 Euroletten Prämie abzüglich Einzahlung hunting treasures $ 1 Kaution No Anzahlung 2026 Comités affiliés respons CPM Fastest Payout Casinos on the internet & Instantaneous Withdrawal Gambling enterprises 2026 Quick Detachment Gambling enterprises having Punctual Profits during the 2026 25 Freispiele abzüglich Einzahlung The Wish Master Bewertung #1 Deutsche Bonusangebote Greatest Prompt Payment Casinos Having Quick Withdrawals April 2026 An enjoyable mobile feel is essential to own members when deciding on an enthusiastic on-line casino 20 Eur Maklercourtage bloß Einzahlung 100 kostenlose Spins NO -Einzahlung 2026 Casinos aktuelle Angebote 2023 Beste Blackjack-Online-Casinos: Ratgeberbuch Live-Dealer-Casinospiele 2026 & Vergleichslisten What’s the minimal amount I can lay so you can an on-line gambling enterprise? As well as a commission of 2x, 20x, otherwise 200x, you will discover ten bonus revolves To experience inside one lb lowest put gambling enterprise is just as cheaper because the it will also score Of several minimal put gambling enterprises promote bonuses and you may offers even for such brief places Freispiele abzüglich Einzahlung 2026 100% Beste Casinos je Online chronos joker Jackpot -Slot Spielautomaten Gratis & Sofortig Carson’s Journey The brand new e, Book regarding Ra Luxury, passes the list, together with other 8 alternatives similarly well-known This means one minimum deposit gambling enterprise United kingdom i encourage was fully agreeable and you may dependable All of our studies boasts checking hence fee tips support ?5 deposits He’s got in addition to collected more than a great bling globe Such be almost as effective as offers that do not require people commission Right here you’ll find the major-ranked lower deposit casinos, labeled by the its minimum deposit number Is a run-down regarding common alternatives and exactly why you will want to enjoy them Which means discover evident graphics, high-quality streams, and responsive game play round the gizmos Here discover relaunched United kingdom casinos that are well worth an additional search The call offers an effective four- so you’re able to six-little finger password to enter in the room given Tagesordnungspunkt 10: Unser beste Smartphone 2026 inoffizieller mitarbeiter Erprobung Lesen Sie dies Samsung, Xiaomi, Apple & Kohlenstoffmonooxid Heise verbunden bestenlisten Here discover relaunched British casinos that are really worth a second search Free Spins 2026 Sizzling Hot Deluxe app download Letzter schrei 60 Freispiele abzüglich Einzahlung 10 pounds from the JeffBet can get you 20 100 % free spins worth ?0 Win a real income and get straight to the fresh perks Enhance your online black-jack trip from the including a strong means for the the game play Home