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


PHP CRM_Mailing_BAO_Mailing::getTestRecipients方法代碼示例

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


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

示例1: queue

 /**
  * @param array $testParams
  */
 public function queue($testParams = NULL)
 {
     $mailing = new CRM_Mailing_BAO_Mailing();
     $mailing->id = $this->mailing_id;
     if (!empty($testParams)) {
         $mailing->getTestRecipients($testParams);
     } else {
         // We are still getting all the recipients from the parent job
         // so we don't mess with the include/exclude logic.
         $recipients = CRM_Mailing_BAO_Recipients::mailingQuery($this->mailing_id, $this->job_offset, $this->job_limit);
         // FIXME: this is not very smart, we should move this to one DB call
         // INSERT INTO ... SELECT FROM ..
         // the thing we need to figure out is how to generate the hash automatically
         $now = time();
         $params = array();
         $count = 0;
         while ($recipients->fetch()) {
             if ($recipients->phone_id) {
                 $recipients->email_id = "null";
             } else {
                 $recipients->phone_id = "null";
             }
             $params[] = array($this->id, $recipients->email_id, $recipients->contact_id, $recipients->phone_id);
             $count++;
             if ($count % CRM_Core_DAO::BULK_MAIL_INSERT_COUNT == 0) {
                 CRM_Mailing_Event_BAO_Queue::bulkCreate($params, $now);
                 $count = 0;
                 $params = array();
             }
         }
         if (!empty($params)) {
             CRM_Mailing_Event_BAO_Queue::bulkCreate($params, $now);
         }
     }
 }
開發者ID:vakeesan26,項目名稱:civicrm-core,代碼行數:38,代碼來源:MailingJob.php

示例2: queue

 public function queue($testParams = null)
 {
     require_once 'CRM/Mailing/BAO/Mailing.php';
     $mailing = new CRM_Mailing_BAO_Mailing();
     $mailing->id = $this->mailing_id;
     if (!empty($testParams)) {
         $mailing->getTestRecipients($testParams);
     } else {
         // We are still getting all the recipients from the parent job
         // (The original so we don't mess with the include/exclude) logic
         $recipients = $mailing->getRecipientsObject($this->parent_id, false, $this->job_offset, $this->job_limit);
         // Here we will use the parent jobid to fetch the receipents, except
         // We will introduce the limit and offset from the child job DAO object
         // To only pick up segment of the receipents instead of the whole
         while ($recipients->fetch()) {
             $params = array('job_id' => $this->id, 'email_id' => $recipients->email_id, 'contact_id' => $recipients->contact_id);
             CRM_Mailing_Event_BAO_Queue::create($params);
         }
     }
 }
開發者ID:hampelm,項目名稱:Ginsberg-CiviDemo,代碼行數:20,代碼來源:Job.php


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