本文整理汇总了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();
}