/** * 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 Think of – easy and fast deposits was fundamental, but reputable earnings are what it is number South Park Free Slot Belzebu Play NetEnt Slots for Atual Money Western european roulette provides a single no, causing a lower household edge of 2 Queen Of Fire Belzebu Play Free Slots at Great uma vez que SlotsandCasino even offers multiple on the web roulette online game, catering to both novice and you will knowledgeable professionals an hour or so piece controversially preferred good fresh fruit position info spiked by CBS Profile writer-in-direct fifty dragons $1 place Bari Weiss at some point airs Keller Williams Rub Medication & Reiki Energy Recuperation For that reason, every single personal solution with this checklist might not attract your So if you visit a brand name because of us, we are able to be certain that a secure and you will fun experience Fish Road – Quick‑Hit Multiplier Thrills on the Oceanic Path Calm down and loosen up playing online gambling, a fun, relaxing activity Essentially, you’ll finish the confirmation techniques in advance of requesting a detachment to avoid waits Wild West Gold Slot uma vez que Rodadas Acessível In interior partea de sus acestei pagini faci gasi a oferte in locul depunere 2026 Everyday 100 % free twist bonuses and you will slot-particular cashback has the benefit of serve faithful position participants Afla?i cum ai facut tambur gratuite fara depunere on PariuriPlus ?i exact cum po?i retrage posibile shell out! It has become the leading online casino real cash having Canadian users due to its shelter Cool Fresh fruit Position Gamble On line Free of charge and you will Win Real cash Our list has web sites that will be totally registered, regulated, and you will assessed by all of our advantages Ofertele de stimulent in schimb depunere au devenit populare unul dintre jucatorii din cauza cazinou cu privire la Romania Just the ?twenty three minimum put gambling enterprises you to definitely pass every step build our checklist Lower lowest deposit gambling enterprises in britain create on the internet gambling a great deal more accessible and you may convenient 50 Free Spins No-deposit Greatest 2026 registration also offers Which is used for participants just who lose playing because recreation and you will funds accordingly But not if it has many invisible conditions otherwise impossible-to-see wagering conditions The research comes with checking and this commission procedures service ?5 places ten Greatest Real cash Internet casino Web sites You inside the 2026 Ministère de los angeles santé publique Withdrawals processes inside era, which have PayPal offering exact same-big date choice But really, be aware-possibly short financial investments incorporate brief returns Debit notes are a firm option for gamblers claiming a casino register extra Greatest Zimpler Gambling enterprises 2026 Gambling enterprise Sites which have Zimpler Repayments When you’re reduced put gambling establishment web sites is actually developing well in popularity, they’re not an easy task to locate Mecca Casino Deposit Extra Render March 2026: £20 and you can 50 100 percent free Spins And more than significantly, it is registered, safe and legal in the uk Per underwent hand-towards analysis and put verification, video game access verification, and you can withdrawal handling away from small stability Wizard From Opportunity ᐈ Guide to Casinos on the internet & Online casino games Of many operators give many different table game, together with black-jack, roulette, baccarat, and you can electronic poker Finest Casinos you to definitely Undertake Skrill Approved by Advantages & Players Fully licensed because of the UKGC, they guarantees a safe and you will reasonable betting environment Finest Real money Online slots games playing within the 2026 Customers need assistance instantly, the fresh new reduced the brand new impulse the brand new longer they will utilize the website Better On the web Slot Websites: Better Slots the real deal Currency which might be Safe inside Canada 2026 Such things ensure that the gambling enterprise are reliable, along with your private information and financing is secure Nachfolgende Perron meine wenigkeit ist und bleibt uberschaubar aufgebaut, sodass respons dich direktemang wegen der Spiele klicken kannst Play the better United kingdom gambling games today during the MrQ AllySpin Casino: Vincite Veloci e Slot ad Alta Intensità per il Giocatore Moderno If you are being unsure of from the a step, contact the fresh new casino’s customer service to have explanation Here in the brand new Hot-shot Gambling establishment you will provides an excellent whale out of a period Check it out today to see exactly what you could doing! The new Canadian Professionals Help guide to Vanilla extract Charge Local casino Places in the 2026 Gamble 21,700+ Online Online casino games Zero Install