function __construct()
 {
     $this->id = 'finished_course';
     $this->title = __('Finished course', 'learn_press');
     $this->template_html = 'emails/finished-course.php';
     $this->template_plain = 'emails/plain/finished-course.php';
     $this->default_subject = __('[{site_title}] You have finished course ({course_name})', 'learn_press');
     $this->default_heading = __('Finished course', 'learn_press');
     parent::__construct();
 }
 function __construct()
 {
     $this->id = 'rejected_course';
     $this->title = __('Rejected course', 'learn_press');
     $this->template_html = 'emails/rejected-course.php';
     $this->template_plain = 'emails/plain/rejected-course.php';
     $this->default_subject = __('[{site_title}] Your course {course_name} has rejected', 'learn_press');
     $this->default_heading = __('Rejected course', 'learn_press');
     parent::__construct();
 }
 function __construct()
 {
     $this->id = 'enrolled_course';
     $this->title = __('Enrolled course', 'learn_press');
     $this->template_html = 'emails/enrolled-course.php';
     $this->template_plain = 'emails/plain/enrolled-course.php';
     $this->subject = __('[{site_title}] New course for review ({course_name}) - {course_date}', 'learn_press');
     $this->heading = __('New course', 'learn_press');
     parent::__construct();
 }
 function __construct()
 {
     $this->id = 'new_order';
     $this->title = __('New order', 'learn_press');
     $this->template_html = 'emails/new-order.php';
     $this->template_plain = 'emails/plain/new-order.php';
     $this->subject = __('[{site_title}] New course for review ({course_name}) - {course_date}', 'learn_press');
     $this->heading = __('New course', 'learn_press');
     parent::__construct();
 }
 function __construct()
 {
     $this->id = 'enrolled_course';
     $this->title = __('Enrolled course', 'learn_press');
     $this->template_html = 'emails/enrolled-course.php';
     $this->template_plain = 'emails/plain/enrolled-course.php';
     $this->default_subject = __('[{site_title}] You have enrolled course ({course_name})', 'learn_press');
     $this->default_heading = __('Enrolled course', 'learn_press');
     add_action('learn_press_user_enrolled_course_notification', array($this, 'trigger'), 99, 3);
     parent::__construct();
 }
 function __construct()
 {
     $this->id = 'new_course';
     $this->title = __('New course', 'learn_press');
     $this->template_html = 'emails/new-course.php';
     $this->template_plain = 'emails/plain/new-course.php';
     $this->default_subject = __('[{site_title}] New course has submitted for review ({course_name})', 'learn_press');
     $this->default_heading = __('New course', 'learn_press');
     $this->recipient = LP()->settings->get('emails_new_course.recipient');
     parent::__construct();
 }
 function __construct()
 {
     $this->id = 'new_order';
     $this->title = __('New order', 'learn_press');
     $this->template_html = 'emails/new-order.php';
     $this->template_plain = 'emails/plain/new-order.php';
     $this->subject = __('[{site_title}] New course for review ({course_name}) - {course_date}', 'learn_press');
     $this->heading = __('New course', 'learn_press');
     add_action('learn_press_order_status_pending_to_processing_notification', array($this, 'trigger'));
     add_action('learn_press_order_status_pending_to_completed_notification', array($this, 'trigger'));
     add_action('learn_press_order_status_processing_to_completed_notification', array($this, 'trigger'));
     parent::__construct();
 }
Exemple #8
0
 function __get($key)
 {
     if (empty($this->{$key})) {
         switch ($key) {
             case 'email':
                 $this->{$key} = LP_Email::instance();
                 break;
             case 'checkout':
                 $this->{$key} = LP_Checkout::instance();
                 break;
             case 'course':
                 if (is_course()) {
                     $this->{$key} = LP_Course::get_course(get_the_ID());
                 }
                 break;
             case 'quiz':
                 if (is_quiz()) {
                     $this->{$key} = LP_Quiz::get_quiz(get_the_ID());
                 }
                 break;
         }
     }
     return !empty($this->{$key}) ? $this->{$key} : false;
 }
/**
 * Send email notification.
 *
 * @param string $to
 * @param string $action
 * @param array  $vars
 *
 * @return mixed
 */
function learn_press_send_mail($to, $action, $vars)
{
    $email_settings = LP_Settings::instance('emails');
    // get_option( '_lpr_settings_emails' );
    if (!$email_settings->get($action . '.enable')) {
        return "The action {$action} doesnt support";
    }
    $user = get_user_by('email', $to);
    if (in_array('administrator', $user->roles)) {
        //return;
    }
    // Set default template vars.
    $vars['log_in'] = apply_filters('learn_press_site_url', get_home_url());
    // Send email.
    $email = new LP_Email();
    $email->set_action($action);
    $email->parse_email($vars);
    $email->add_recipient($to);
    return $email->send();
}