當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SendPress_Data::add_subscriber_event方法代碼示例

本文整理匯總了PHP中SendPress_Data::add_subscriber_event方法的典型用法代碼示例。如果您正苦於以下問題:PHP SendPress_Data::add_subscriber_event方法的具體用法?PHP SendPress_Data::add_subscriber_event怎麽用?PHP SendPress_Data::add_subscriber_event使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SendPress_Data的用法示例。


在下文中一共展示了SendPress_Data::add_subscriber_event方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: bounce_email

 static function bounce_email($email)
 {
     $id = SendPress_Data::get_subscriber_by_email($email);
     if ($id !== false) {
         $lists = SendPress_Data::get_lists_for_subscriber($id);
         foreach ($lists as $list) {
             if ($list->status == 2) {
                 $report_id = SendPress_Data::get_last_send($id);
                 SendPress_Data::update_subscriber_status($list->listID, $id, 4, false);
                 //( $sid, $rid, $uid, $ip , $device_type, $device, $type='confirm' )
                 //( $sid, $rid, $lid=null, $uid=null, $ip=null, $device_type=null, $device=null, $type='confirm' )
                 SendPress_Data::add_subscriber_event($id, $report_id, $list->listID, null, null, null, null, 'bounce');
             }
         }
     }
 }
開發者ID:pedro-mendonca,項目名稱:sendpress,代碼行數:16,代碼來源:class-sendpress-data.php

示例2: send_single_from_queue

 static function send_single_from_queue()
 {
     global $wpdb;
     //$emails = $this->wpdbQuery("SELECT * FROM ".$this->queue_table()." WHERE success = 0 AND max_attempts != attempts LIMIT ".$limit,"get_results");
     $count = 0;
     $attempts = 0;
     $queue_table = SendPress_Data::queue_table();
     if (SendPress_Manager::limit_reached()) {
         return array('attempted' => $attempts, 'sent' => $count);
     }
     SendPress_Email_Cache::build_cache();
     $email = SendPress_Data::get_single_email_from_queue(true);
     if (is_object($email)) {
         //$email = $email[0];
         if (SendPress_Manager::limit_reached()) {
             return array('attempted' => $attempts, 'sent' => $count);
         }
         $attempts++;
         SendPress_Data::queue_email_process($email->id);
         $result = SendPress_Manager::send_email_from_queue($email);
         if ($result) {
             if ($result === true) {
                 $wpdb->update(SendPress_Data::queue_table(), array('success' => 1, 'inprocess' => 3), array('id' => $email->id));
                 //( $sid, $rid, $lid=null, $uid=null, $ip=null, $device_type=null, $device=null, $type='confirm' )
                 $wpdb->insert(SendPress_Data::subscriber_tracker_table(), array('subscriberID' => $email->subscriberID, 'emailID' => $email->emailID, 'sent_at' => get_gmt_from_date(date('Y-m-d H:i:s'))));
                 SendPress_Data::add_subscriber_event($email->subscriberID, $email->emailID, $email->listID, null, null, null, null, 'send');
             } else {
                 $wpdb->update(SendPress_Data::queue_table(), array('success' => 2, 'inprocess' => 3), array('id' => $email->id));
                 SendPress_Data::add_subscriber_event($email->subscriberID, $email->emailID, $email->listID, null, null, null, null, 'bounce');
                 SendPress_Data::bounce_subscriber_by_id($email->subscriberID);
             }
             $count++;
         } else {
             $wpdb->update($queue_table, array('attempts' => $email->attempts + 1, 'inprocess' => 0, 'last_attempt' => date('Y-m-d H:i:s')), array('id' => $email->id));
         }
     } else {
         //We ran out of emails to process.
         return array('attempted' => $attempts, 'sent' => $count);
     }
     //SendPress_Manager::increase_email_count( $attempts );
     return array('attempted' => $attempts, 'sent' => $count);
 }
開發者ID:pedro-mendonca,項目名稱:sendpress,代碼行數:42,代碼來源:class-sendpress-manager.php

示例3: send_mail_cron

 static function send_mail_cron()
 {
     //@ini_set('max_execution_time',0);
     global $wpdb;
     $count = SendPress_Option::get('emails-per-hour');
     $count = SendPress_Option::get('wpcron-per-call', 25);
     $email_count = 0;
     $attempts = 0;
     if (SendPress_Manager::limit_reached($count)) {
         return;
     }
     SendPress_Email_Cache::build_cache();
     for ($i = 0; $i < $count; $i++) {
         $email = SendPress_Data::get_single_email_from_queue();
         if ($email != null) {
             $attempts++;
             SendPress_Data::queue_email_process($email->id);
             $result = SendPress_Manager::send_email_from_queue($email);
             $email_count++;
             if ($result) {
                 if ($result === true) {
                     $wpdb->update(SendPress_Data::queue_table(), array('success' => 1, 'inprocess' => 3), array('id' => $email->id));
                     //( $sid, $rid, $lid=null, $uid=null, $ip=null, $device_type=null, $device=null, $type='confirm' )
                     //$wpdb->update( SendPress_Data::queue_table() , array('success'=>1,'inprocess'=>3 ) , array('id'=> $email->id ));
                     //$wpdb->insert(SendPress_Data::subscriber_tracker_table() , array('subscriberID'=>$email->subscriberID,'emailID'=>$email->emailID,'sent_at' => get_gmt_from_date( date('Y-m-d H:i:s') )) );
                     SPNL()->db("Subscribers_Tracker")->add(array('subscriber_id' => intval($email->subscriberID), 'email_id' => intval($email->emailID)));
                     SendPress_Data::add_subscriber_event($email->subscriberID, $email->emailID, $email->listID, null, null, null, null, 'send');
                 } else {
                     $wpdb->update(SendPress_Data::queue_table(), array('success' => 2, 'inprocess' => 3), array('id' => $email->id));
                     SendPress_Data::add_subscriber_event($email->subscriberID, $email->emailID, $email->listID, null, null, null, null, 'bounce');
                     SendPress_Data::bounce_subscriber_by_id($email->subscriberID);
                 }
                 //$wpdb->insert( $this->subscriber_open_table(),  $senddata);
                 $count++;
                 //SendPress_Data::update_report_sent_count( $email->emailID );
             } else {
                 $wpdb->update(SendPress_Data::queue_table(), array('attempts' => $email->attempts + 1, 'inprocess' => 0, 'last_attempt' => date('Y-m-d H:i:s')), array('id' => $email->id));
             }
         } else {
             //We ran out of emails to process.
             break;
         }
         set_time_limit(30);
     }
     return;
 }
開發者ID:richardsweeney,項目名稱:sendpress,代碼行數:46,代碼來源:class-sendpress-queue.php


注:本文中的SendPress_Data::add_subscriber_event方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。