Example #1
0
 public function QueueMessages()
 {
     if ($this->Group) {
         foreach ($this->Group->GetActiveGroupParticipationArray() as $objParticipation) {
             $objPerson = $objParticipation->Person;
             EmailOutgoingQueue::QueueMessage($this->EmailMessage, $this->Group->Token, $objPerson);
             // GJS: At this point, also check if there is a co-primary and include them to the list
             if ($objPerson->DateOfBirth && $objPerson->CoPrimary) {
                 $objCoPrimary = Person::Load($objPerson->CoPrimary);
                 if ($objCoPrimary) {
                     EmailOutgoingQueue::QueueMessage($this->EmailMessage, $this->Group->Token, $objCoPrimary);
                 }
             }
         }
         foreach ($this->Group->Ministry->GetLoginArray() as $objLogin) {
             if ($objLogin->DomainActiveFlag && $objLogin->LoginActiveFlag) {
                 EmailOutgoingQueue::QueueMessage($this->EmailMessage, $this->Group->Token, $objLogin);
             }
         }
     } else {
         if ($this->CommunicationList) {
             foreach ($this->CommunicationList->GetPersonArray() as $objPerson) {
                 EmailOutgoingQueue::QueueMessage($this->EmailMessage, $this->CommunicationList->Token, $objPerson);
             }
             foreach ($this->CommunicationList->GetCommunicationListEntryArray() as $objCommunicationListEntry) {
                 EmailOutgoingQueue::QueueMessage($this->EmailMessage, $this->CommunicationList->Token, $objCommunicationListEntry);
             }
             foreach ($this->CommunicationList->Ministry->GetLoginArray() as $objLogin) {
                 if ($objLogin->DomainActiveFlag && $objLogin->LoginActiveFlag) {
                     EmailOutgoingQueue::QueueMessage($this->EmailMessage, $this->CommunicationList->Token, $objLogin);
                 }
             }
         }
     }
 }