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


PHP EmailMessage::LoadByMessageIdentifier方法代碼示例

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


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

示例1: AnalyzeMessage

 /**
  * This will analyze a NotYetAnalyzed message, doing the appropriate
  * things to setup links to related objects, queueing outgoing messages, etc.
  * 
  * This will throw an exception if its MessageType is NOT NotYetAnalyzed.
  * @return void
  */
 public function AnalyzeMessage()
 {
     if ($this->intEmailMessageStatusTypeId != EmailMessageStatusType::NotYetAnalyzed) {
         throw new QCallerException('EmailMessage that is NOT in NotYetAnalyzed status cannot be Analyzed');
     }
     // Do Initial Cleanup and Setup Work
     $this->CleanupAndSetup();
     // Check MessageId
     if (!is_null($this->strMessageIdentifier)) {
         // Duplicate Message -- if so, delete this an move on
         $objMessage = EmailMessage::LoadByMessageIdentifier($this->strMessageIdentifier);
         if ($objMessage && $objMessage->Id != $this->intId) {
             $this->Delete();
             return;
         }
     }
     // First, Figure out what the sender Email address is
     $this->FromAddress = $this->LookupSenderEmailAddress();
     // If not valid, then something is very wrong -- we should punt immediately
     if (is_null($this->FromAddress)) {
         $this->strErrorMessage = 'Invaid From Address';
         $this->intEmailMessageStatusTypeId = EmailMessageStatusType::Error;
         $this->Save();
         return;
     }
     // Next, ensure the entire email message is not larger than 10MB
     if (strlen($this->strRawMessage) > 10485750) {
         $this->strErrorMessage = "Message Too Large\r\n\r\nMessages sent to ALCF Groups must be less than 10MB in size.";
         $this->intEmailMessageStatusTypeId = EmailMessageStatusType::Error;
         $this->Save();
         return;
     }
     // Get a PersonArray and update Login / CommListEntry links
     $objSenderArray = $this->CalculatePotentialSenderArray();
     // Next, Figure out the totel set of *potential* recpieint(s) are
     $strEmailAddressArray = $this->CalculateEmailArray();
     $objGroupArray = $this->LookupGroups($strEmailAddressArray);
     $objCommunicationListArray = $this->LookupCommunicationLists($strEmailAddressArray);
     // At this point, strEmailAddressArray is actually an array of Unmatched Email Addresses
     $strUnmatchedEmailAddressArray = $strEmailAddressArray;
     // Next, iterate throug EACH CommList and Group to see which ones that the sender can send to
     $objUnauthorizedCommuniationListArray = $this->SetupCommunicationListRoutes($objCommunicationListArray, $objSenderArray);
     $objUnauthorizedGroupArray = $this->SetupGroupRoutes($objGroupArray, $objSenderArray);
     // Next, Error Reporting
     $this->SetupErrorMessage($strUnmatchedEmailAddressArray, $objUnauthorizedCommuniationListArray, $objUnauthorizedGroupArray);
     $this->Save();
     // Queue Error Message (if applicable)
     if ($this->ErrorMessage) {
         EmailOutgoingQueue::QueueError($this);
     }
     // Queue Outgoing Messages (if applicable)
     foreach ($this->GetEmailMessageRouteArray() as $objRoute) {
         $objRoute->QueueMessages();
     }
     // Update the status
     $this->intEmailMessageStatusTypeId = EmailMessageStatusType::PendingSend;
     $this->Save();
 }
開發者ID:alcf,項目名稱:chms,代碼行數:65,代碼來源:EmailMessage.class.php


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