コード例 #1
0
 static function external($template_id, $email_id, $subscriber_id, $example)
 {
     //if( $example == false ){
     $link = get_post_meta($template_id, '_footer_link_color', true);
     if ($link == false) {
         $link = '#2469a0';
     }
     $content = get_post_meta($email_id, '_footer_content', true);
     if (!$content) {
         if (self::template_post_exists($template_id)) {
             $content = get_post_meta($template_id, '_footer_content', true);
         } else {
             $content = self::content();
         }
     }
     //$content = $content_post->post_content;
     //remove_filter('the_content','wpautop');
     add_filter('bj_lazy_load_run_filter', '__return_false');
     $content = apply_filters('the_content', $content);
     //add_filter('the_content','wpautop');
     $content = str_replace(']]>', ']]>', $content);
     $content = spnl_do_email_tags($content, $template_id, $email_id, $subscriber_id, $example);
     $content = SendPress_Template::link_style($link, $content);
     /*
     } else {
     	$content = self::lipsum_format();
     }
     */
     if ($content != '') {
         return self::table_start($template_id) . $content . self::table_end($template_id);
     }
     return '';
 }
 static function external($template_id, $email_id, $subscriber_id, $example, $x = false)
 {
     add_filter('bj_lazy_load_run_filter', '__return_false');
     if ($example == false) {
         do_action('sendpress_template_loaded');
         if ($x == false) {
             $content_post = get_post($email_id);
             $content = $content_post->post_content;
         } else {
             $content = $x;
         }
         $content = apply_filters('the_content', $content);
         $content = str_replace(']]>', ']]>', $content);
     } else {
         $content = self::lipsum_format();
     }
     $stat = get_post_status($template_id);
     $content = spnl_do_email_tags($content, $template_id, $email_id, $subscriber_id, $example);
     if ($stat == 'sp-standard') {
         $link = get_post_meta($template_id, '_content_link_color', true);
         if ($link == false) {
             $link = '#2469a0';
         }
         $content = SendPress_Template::link_style($link, $content);
     }
     return $content;
 }
コード例 #3
0
 static function get_instance()
 {
     if (!isset(self::$instance)) {
         $class_name = __CLASS__;
         self::$instance = new $class_name();
     }
     return self::$instance;
 }
コード例 #4
0
 public static function build_cache()
 {
     self::getInstance();
     $email_list = SendPress_Data::get_email_id_from_queue();
     foreach ($email_list as $email) {
         $html = SendPress_Template::get_instance()->render_html($email->emailID, false, false, false);
         self::set($email->emailID, $html);
     }
 }
コード例 #5
0
 function subject()
 {
     // Get any existing copy of our transient data
     //if ( false === ( $email_subject = get_transient( 'sendpress_report_subject_'. $this->id() ) ) || ($this->purge() == true) ) {
     // It wasn't there, so regenerate the data and save the transient
     if (!$this->post_info) {
         $this->post_info = get_post($this->id());
     }
     if ($this->post_info->post_type == 'sp_newsletters' || $this->post_info->post_type == 'sp_report') {
         $email_subject = get_post_meta($this->id(), '_sendpress_subject', true);
     } else {
         $email_subject = $this->post_info->post_title;
     }
     $email_subject = SendPress_Template::tag_replace($email_subject);
     //	set_transient( 'sendpress_report_subject_'. $this->id(), $email_subject , 60*60*2);
     // Get any existing copy of our transient data
     //}
     $subscriber = SendPress_Data::get_subscriber($this->subscriber_id());
     if (!is_null($subscriber)) {
         $email_subject = str_replace("*|FNAME|*", $subscriber->firstname, $email_subject);
         $email_subject = str_replace("*|LNAME|*", $subscriber->lastname, $email_subject);
         $email_subject = str_replace("*|EMAIL|*", $subscriber->email, $email_subject);
         $email_subject = str_replace("*|ID|*", $subscriber->subscriberID, $email_subject);
     }
     return $email_subject;
 }
コード例 #6
0
ファイル: sendpress.php プロジェクト: radscheit/unicorn
 function get_templates()
 {
     _deprecated_function(__FUNCTION__, '0.8.7', 'SendPress_Template::get_instance()->info()');
     return SendPress_Template::get_instance()->info();
 }