function get_email_class($id) { $emails = LP_Emails::instance()->emails; if ($emails) { foreach ($emails as $email) { if ($email->id == $id) { return $email; } } } return false; }
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; }