/**
  * Main LP_Mail Instance
  *
  * Ensures only one instance of LP_Mail is loaded or can be loaded.
  *
  * @since 1.0
  * @static
  * @return LP_Mail instance
  */
 public static function instance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
 function get_email_class($id)
 {
     $emails = LP_Emails::instance()->emails;
     if ($emails) {
         foreach ($emails as $email) {
             if ($email->id == $id) {
                 return $email;
             }
         }
     }
     return false;
 }
Example #3
0
 public function send($to, $subject, $message, $headers, $attachments)
 {
     add_filter('wp_mail_from', array($this, 'get_from_address'));
     add_filter('wp_mail_from_name', array($this, 'get_from_name'));
     add_filter('wp_mail_content_type', array($this, 'get_content_format'));
     $message = apply_filters('learn_press_mail_content', $this->apply_style_inline($message));
     //$return  =  wp_mail( $to, $subject, $message, $headers, $attachments );
     $return = LP_Emails::instance()->send($this->get_from_address(), $to, $subject, $message, $headers, $attachments);
     remove_filter('wp_mail_from', array($this, 'get_from_address'));
     remove_filter('wp_mail_from_name', array($this, 'get_from_name'));
     remove_filter('wp_mail_content_type', array($this, 'get_content_format'));
     return $return;
 }
Example #4
0
 /**
  * Init LearnPress when WP initialises
  */
 function init()
 {
     if ($this->is_request('frontend')) {
         $this->cart = LP_Cart::instance();
     }
     $this->get_session();
     $this->get_user();
     $this->gateways = LP_Gateways::instance()->get_available_payment_gateways();
     //$this->question_factory = LP_Question_Factory::instance();
     LP_Emails::init_email_notifications();
 }
Example #5
0
 /**
  * Init LearnPress when WP initialises
  */
 function init()
 {
     if ($this->is_request('frontend')) {
         $this->cart = LP_Cart::instance();
     }
     $this->get_session();
     $this->get_user();
     $this->gateways = LP_Gateways::instance()->get_available_payment_gateways();
     //$this->question_factory = LP_Question_Factory::instance();
     LP_Emails::init_email_notifications();
     if (get_transient('learn_press_install') == 'yes') {
         flush_rewrite_rules();
         delete_transient('learn_press_install');
     }
 }