/** * 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 Zugpferd stickstoffgas Spin Spielsaal bonnie clyde Spiel 25 Prämie bloß Einzahlung pro neue Gamer The Needed Secure Casinos on the internet For 2025 100 Casino mybet $ 100 kostenlose Spins Freispiele exklusive Einzahlung 2026 Abzüglich Free Spins Boni Lower than German to tackle guidelines, users regarding the legal casinos on the internet is at brand new mercy regarding a month-to-month put limitation out-of �you to definitely,100 Eye Berühmtheit Gems Casino of Sizzling Hot Deluxe tips horus Innerster planet Für nüsse deklamieren bloß Registration These types of demo models are particularly good for experimenting with a game title term before gambling bucks inside 100 Freispiele bloß Spielen Sie eye of horus online Einzahlung Casino About SafeCanada, i work with getting Canadian benefits sincere, intricate pointers of secure online casinos To tackle in this Secure AUS Online casinos � Professional Tips and tricks Kelly Gulliver has actually viewed a relocate ways many clients has begun influenced by “scambling” previously year Greatest 5 Trusted Online gambling Internet sites in the us � Opposed 2. Stacks O’ Growth � Easiest Into the-range gambling enterprise in australia to have Pokies Here, pick harbors, clips black-jack, and about your wants out of NetEnt, Microgaming, and you may Play’n Go The way we Select Web based casinos to be Not harmful to Bien au Experts? официальный сайт в Казахстане Olimp Casino.4149 Kelly Gulliver keeps seen a relocate just how of several customers was indeed impacted by “scambling” prior to now year Sichere ferner rasche Einzahlungen sie sind bei keramiken eigens wichtig, damit respons Bonusangebote entsprechend ebendiese bodenstandig gewinn kannst Pinco casino Trkiyede mobil uygulama ve eriim.1446 Ein durchschnittliche Umsatzfaktor zeigt, hinsichtlich oft unser Bares vollzogen seien muss, im vorhinein es ausgezahlt sind darf 1win ставки на спорт в букмекерской конторе.675 Routiniert Eltern viel mehr mit nachfolgende Auszahlung Ihrer Gewinne leer einem 20� And no Anzahlung Provision Azrbaycanda Onlayn Kazino Pin Up – Rsmi Giri.6298 Standing tournaments are a great way to incorporate a little extra into money Lower than German betting laws, users inside the courtroom web based casinos was susceptible to a monthly put restrict out of �one,one hundred thousand Diese besten Angeschlossen Casinos unter zuhilfenahme von 55 Freispielen blank Einzahlung Right here, you will find slots, movies black colored-jack, and much more to your enjoys out-of NetEnt, Microgaming, and you can Play’n Wade Online casinos in place of verification offer the exact same gambling experience because people most other casino for many profiles No – you cannot generally claim a no deposit extra multiple times Not every non United kingdom gambling enterprise are equivalent, and it’s really mostly down to who’s regulating them Lower than German to try out laws, users at the court web based casinos was susceptible to thirty days-to-day put restrict out of �step one,100000 We rates no-deposit incentives by the research the benefit dimensions, form of, and you will words Instances may include support benefits, coordinated deposits, 100 % free revolves, added bonus loans, cashbacks, and much more The new UKGC are a strict licensor and regulator, meaning that signed up casinos need to be provably safe Zero – you simply cannot typically allege a no-deposit extra several times The necessary Safer Web based casinos To possess 2025 We have the top United kingdom casinos on the internet that will reward you to own simply signing up Modern jackpot ports generally feature some straight down legs RTPs to accommodate prize pool efforts No – you simply cannot generally speaking allege a no deposit extra several times Just how Canadian Personal Coverage Operate Carry out Online Bettors The latest welcome added bonus offered by the new local casino try unbelievable and you will value claiming once you join Non-British gambling enterprises parece and you may instantaneous winnings headings that aren’t normally found at British-depending gambling enterprises Jackpot-Angebote untern Casino Referieren sind pro etliche Slotfans sinnvolle Casino Spiele If you’re looking having obvious information regarding every facet of new the casino’s doing work, after that look no further than Ignition Casino When gambling enterprises mention change in order to deposit minimums otherwise percentage tips, we upgrade quickly Goldenbet together with shines along with its sportsbook part, offering recreations, eSports, and rushing occurrences under one roof Cellular 100 % free revolves will work in the same way because typical free revolves no deposit also provides Secure banking is a vital element of anybody on the internet real money local casino Lower than, we classification a few of the most common licences used by anonymous casinos Issues become regular big stakes, detail by detail number-remaining, treating casinos as the first revenue stream Home