/** * 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 - Page 2 Skip to content
Redplum Films TV
  • Home
  • About
  • Services
  • Show Reels
  • Photography Portfolio
  • Contact
Contact US
Contact US
Redplum Films TV
  • Home
  • About
  • Services
  • Show Reels
  • Photography Portfolio
  • Contact

! Без рубрики

Обзор сайта Up X: что нужно знать о платформе

Leave a Comment / ! Без рубрики / xtw183877538

Up X — это современная онлайн-платформа, которая предлагает пользователям широкий спектр услуг, от получения информации до проведения транзакций. Благодаря удобному интерфейсу и множеству функций, сайт стал популярным среди российских пользователей. В этой статье мы подробно разберем основные возможности Up X, его преимущества и недостатки, а также ответим на самые часто задаваемые вопросы. Что такое Up […]

Обзор сайта Up X: что нужно знать о платформе Read More »

estanozolol españa 16

Leave a Comment / ! Без рубрики / xtw183877538

Estanozolol Nombre Comercial: Winstrol El uso excesivo de esteroides anabólicos puede generar estragos en el eje endocrino humano, teniendo como consecuencia el hecho de que el cuerpo deje de producir testosterona por sí mismo. Según expertos, los deportes de potencia y fuerza son los eventos donde es más possible que los tramposos potenciales utilicen este

estanozolol españa 16 Read More »

estanozolol 10 mg donde comprar 8

Leave a Comment / ! Без рубрики / xtw183877538

Stanozolol 10 Mg Cygnus Comprar Sin Receta En España Y Madrid En Es-farmacologia Com Además, este esteroide anabólico tiene propiedades anti-catabólicas, lo que significa que ayuda a prevenir la degradación muscular y promueve la recuperación más rápida después del ejercicio. Stanover 10 mg Vermodje es un medicamento popular para aumentar la masa muscular y fortalecer

estanozolol 10 mg donde comprar 8 Read More »

Бонус до X рублей

Leave a Comment / ! Без рубрики / xtw183877538

  🎉 Всё о бонусах up x bonus В мире азартных игр и онлайн-казино часто встречается термин up x bonus. Этот вид поощрения позволяет игрокам увеличить свои выигрыши и получить дополнительные преимущества при игре. Давайте разберёмся, что же стоит знать об этом бонусе! 🚀 📝 Что такое up x bonus? 🤔 Up x bonus —

Бонус до X рублей Read More »

Apple Inc. Revolutionizing Technology and Design

Leave a Comment / ! Без рубрики / xtw183877538

Apple Inc. is a globally renowned American technology company that has played a pivotal role in shaping the modern digital landscape. Founded in 1976 by Steve Jobs, Steve Wozniak, and Ronald Wayne, Apple started as a personal computer pioneer and evolved into one of the world’s most valuable and influential brands. Headquartered in Cupertino, California,

Apple Inc. Revolutionizing Technology and Design Read More »

¿Dónde comprar oxandrolona 7

Leave a Comment / ! Без рубрики / xtw183877538

Todo Lo Que Debes Saber Sobre La Legalidad De La Oxandrolona En España: ¿es Authorized Comprar Y Usar Este Esteroide? Para el culturismo y el crecimiento muscular, generalmente se usa una dosis más alta de 10 mg por día, mientras que se recomiendan dosis más bajas para objetivos generales de salud y estado físico. La

¿Dónde comprar oxandrolona 7 Read More »

anabolizantes online

Leave a Comment / ! Без рубрики / xtw183877538

Viagra, Anabolizantes Y Diet�ticos, Los Medicamentos Que M�s Se Falsifican Se produce atrofia de conductos seminíferos y disminución del tamaño testicular, lo que ocasiona una infertilidad con una disminución de hasta un 73% en el recuento de espermatozoides y cambios a veces irreversibles en la espermatogénesis47. También se ha detectado una agresividad exagerada en el

anabolizantes online Read More »

Post pagination
← Previous 1 2

 

  • Home
  • About
  • Services
  • Show Reels
  • Photography Portfolio
  • Contact

Copyright © 2026 Redplum Media Production