当前位置: 首页>>代码示例>>PHP>>正文


PHP SendPress_Data::add_email_to_queue方法代码示例

本文整理汇总了PHP中SendPress_Data::add_email_to_queue方法的典型用法代码示例。如果您正苦于以下问题:PHP SendPress_Data::add_email_to_queue方法的具体用法?PHP SendPress_Data::add_email_to_queue怎么用?PHP SendPress_Data::add_email_to_queue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SendPress_Data的用法示例。


在下文中一共展示了SendPress_Data::add_email_to_queue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: queue_batch

 function queue_batch()
 {
     $this->verify_ajax_call();
     $reportid = isset($_POST['reportid']) ? $_POST['reportid'] : 0;
     $lists = get_post_meta($reportid, '_send_lists', true);
     $time = get_post_meta($reportid, '_send_time', true);
     $list = explode(",", $lists);
     $last = get_post_meta($reportid, '_send_last', true);
     //$count_last = get_post_meta($reportid, '_send_last_count', true);
     if ($last == false) {
         $last = 0;
         $count_last = 0;
     }
     $x = SendPress_Data::get_active_subscribers_lists_with_id($list, $last);
     foreach ($x as $email) {
         $go = array('from_name' => 'queue', 'from_email' => 'queue', 'to_email' => $email->email, 'emailID' => $reportid, 'subscriberID' => $email->subscriberID, 'subject' => '', 'date_sent' => $time, 'listID' => $email->listid);
         SendPress_Data::add_email_to_queue($go);
     }
     //if()
     if (count($x) == intval(SendPress_Option::get('queue-per-call', 1000))) {
         $w = end($x);
         update_post_meta($reportid, '_send_last', $w->subscriberID);
         echo json_encode(array("lastid" => $w->subscriberID, "count" => count($x)));
         exit;
     }
     update_post_meta($reportid, '_send_last', -1);
     echo json_encode(array("lastid" => 0, "count" => count($x)));
     exit;
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:29,代码来源:class-sendpress-ajax-loader.php

示例2: send_optin

 static function send_optin($subscriberID, $listids, $lists)
 {
     //SendPress_Error::log('send optin');
     $subscriber = SendPress_Data::get_subscriber($subscriberID);
     $l = '';
     $optin_id = 0;
     foreach ($lists as $list) {
         if (in_array($list->ID, $listids)) {
             $l .= $list->post_title . " <br>";
             if ($optin_id === 0) {
                 $o = get_post_meta($list->ID, 'opt-in-id', true);
                 if ($o === "") {
                     $o = 0;
                 }
                 if ($o > 0) {
                     $optin_id = $o;
                 }
             }
         }
     }
     //	add_filter( 'the_content', array( $this, 'the_content') );
     $optin = $optin_id > 0 ? $optin_id : SendPress_Data::get_template_id_by_slug('double-optin');
     $user = SendPress_Data::get_template_id_by_slug('user-style');
     SendPress_Posts::copy_meta_info($optin, $user);
     SendPress_Email_Cache::build_cache_for_system_email($optin);
     $go = array('from_name' => 'queue', 'from_email' => 'queue', 'to_email' => $subscriber->email, 'emailID' => intval($optin), 'subscriberID' => intval($subscriberID), 'subject' => '', 'listID' => 0);
     $id = SendPress_Data::add_email_to_queue($go);
     SPNL()->load("Subscribers_Tracker")->add(array('subscriber_id' => intval($subscriberID), 'email_id' => intval($optin), 'tracker_type' => SendPress_Enum_Tracker_Type::Confirm));
     $confirm_email = SendPress_Data::get_single_email_from_queue_by_id($id);
     SendPress_Email_Cache::build_cache_for_system_email($confirm_email->id);
     $confirm_email->is_confirm = true;
     SendPress_Queue::send_the_queue($confirm_email);
     /*
     $message = new SendPress_Email();
     $message->id($optin);
     $message->subscriber_id($subscriberID);
     $message->remove_links(true);
     $message->purge(true);
     $html = $message->html();
     $message->purge(false);
     $text = $message->text();
     
     $code = array(
     		"id"=>$subscriberID,
     		"listids"=> implode(',',$listids),
     		"view"=>"confirm"
     	);
     $code = SendPress_Data::encrypt( $code );
     
     if( SendPress_Option::get('old_permalink') || !get_option('permalink_structure') ){
     	$link = home_url() ."?sendpress=".$code;
     } else {
     	$link = home_url() ."/sendpress/".$code;
     }
     
     $href = $link;
     $html_href = "<a href='". $link  ."'>". $link  ."</a>";
     
     
     $html = str_replace("*|SP:CONFIRMLINK|*", $html_href , $html );
     $text = str_replace("*|SP:CONFIRMLINK|*", $href , $text );
     $text = nl2br($text);
     $sub =  $message->subject();
     SPNL()->load("Subscribers_Tracker")->add( array('subscriber_id' => intval( $subscriberID ), 'email_id' => intval( $optin), 'tracker_type' => SendPress_Enum_Tracker_Type::Confirm ) );
     //SendPress_Data::register_event( 'confirm_sent', $subscriberID );			
     SendPress_Manager::send( $subscriber->email, $sub , $html, $text, false );
     */
 }
开发者ID:pedro-mendonca,项目名称:sendpress,代码行数:68,代码来源:class-sendpress-manager.php

示例3: add_email_to_queue

 function add_email_to_queue($values)
 {
     /*
     global $wpdb;
     $table = SendPress_Data::queue_table();
     $messageid = $this->unique_message_id();
     $values["messageID"] = $messageid;
     $values["date_published"] = date('Y-m-d H:i:s');
     $wpdb->insert( $table, $values);
     */
     SendPress_Data::add_email_to_queue($values);
 }
开发者ID:radscheit,项目名称:unicorn,代码行数:12,代码来源:sendpress.php


注:本文中的SendPress_Data::add_email_to_queue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。