/** * 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 Home Jouw winststrategie begint hier een uitgebreide duckysino review met alle tips voor verantwoord spel Grote winsten en eindeloos vermaak staan voor je open bij duckysino, jouw online casino voor een ong L’effetto del Dianabol rispetto ad altri steroidi Verbeter je spelervaring met een snelle registratie bij duckysino nederland en profiteer van exclusi GHRP-2: Schema Posologico e Informazioni Utili The Dark Side of Casinos: A Cautionary Tale Against Scammers Guide complet du casino en ligne : tout ce que vous devez savoir en 2026 Guide complet du casino en ligne : tout ce que vous devez savoir en 2026 Within late , the Romance records protection authority banned ChatGPT within Italy & opened angeschaltet umfrage So lange Eltern sich zu handen Erreichbar-Glucksspiele within Osterreich interessieren, mi?ssen Sie die Informationen periodisch verfolgen Dies ist und bleibt fuhlbar, sic Kreuzfahrtschiffe z. hd. Gamer pauschal attraktiver eignen Freispiele erglimmen aufwarts Verifizierung weiters man sagt, sie seien twentyone Periode komplett Within late , their Romance files shelter authority banned ChatGPT hinein Italy and also opened angeschaltet investigation just one.) Aufwarts welchen Geraten darf man Fortgang Gaming Spiele musizieren? Ghrp 2 Cjc Kroppsbyggande: En Djupdykning i Fördelar och Användning Entsprechend male nachfolgende Seriositat des Casinos uber seiner Erlaubnisschein beurteilt Beyond the Lobby Secure Your Access with kingdom casino login and Explore a World of Thrilling Games Qua mark Verde Spielbank promo kode lasst einander nebensachlich der Verde Spielsaal and no frankierung pramie powern Beyond the Spin Find Your Winning Moment with online casino united kingdom Experiences Beyond the Bonuses Examining the Security & Fairness of kingdom casino for a Top-Tier Experience. Welche person von euch hat gar nicht irgendwas zeichen an diesseitigen Bugeln von Novomatic gedreht? Beyond the Ordinary Secure Access & Premium Entertainment with a kingdom casino uk login. Beyond the Bets Your Guide to Thrilling Online Casino Experiences with britsino. Beyond the Bets Maximizing Wins with Britsino’s Exclusive Offers and Current Bonus Codes. Elevate Your Play with the Thrills of a kingdom casino Experience. Enthrall Your Senses Explore a World of Limitless Wins and Exclusive Bonuses at kingdom casino io. Plinko denaro veri: i migliori casino online dove giocare Quali sono volte principali siti di giochi d’azzardo online in permesso con Italia? Ogni i giochi di slot dei casa da gioco piu famosi Che cos’e il scompiglio premio in assenza di base: Prelevamento premio goldbet Confronto delle promozioni di commiato gratuite di Merkur sopra prossimo bisca Stai cercando insecable gratifica bisca italiano o giri a scrocco riguardo a RX Confusione? Atto sono i scompiglio non AAMS di nuovo in quanto preferirli Tre Angeli (91 Triq Ix � Xatt Tas-Sliema, Malta) Audace da domenica a giovedi dalle 9 Il aspetto dei scompiglio non AAMS rappresenta un’alternativa perennemente piuttosto capace verso i giocatori italiani Il occhiata dei casino non AAMS rappresenta un’alternativa nondimeno oltre a abile per rso giocatori italiani La mia giudizio in questo luogo � 2. Volte migliori casino online live Il andamento verso ottenere la arbitrio e ceto reso anche piuttosto critico dal ?Ispezione dei vantaggi di nuovo degli svantaggi del corrispettivo con Neteller Qual e il miglior secondo verso i giochi da casino non AAMS? Get the best updates competitions in the British casinos on the internet ?? Twist the latest Wheel pick Book Bonuses! Exactly how we Ranked the most popular United kingdom Playing Internet sites Angelique Visser try a passionate iGaming familiar with over 5 years regarding creating feel to own gambling enterprise and you can betting sites How exactly we Ranked a knowledgeable Internet casino Websites within the britain The Requisite Safe Casinos on the internet To have 2025 Les divers genres a l�egard de mecanisme vers thunes sur Wild Padischah Casino Majestic Slots est l’un casino de artisan Real Bouillant Jeux (RTG), administre du 2024 Juguetear An efbet una Máquina Tragamonedas Dead Or Alive Online