コード例 #1
0
 /**
  * @param MailSystemResult $result
  * @param ProcessedOutboundMessage $processedMessage
  */
 protected function handleMailSystemResult(MailSystemResult $result, ProcessedOutboundMessage $processedMessage)
 {
     $storableMessage = $processedMessage->getStorableMessage();
     foreach ($result->getMailSystemMessagesStatus() as $mailSystemMessageStatus) {
         $messageStatus = new StorableOutboundMessageStatus($storableMessage, $mailSystemMessageStatus);
         $storableMessage->addMessageStatus($messageStatus);
         $this->entityManager->persist($messageStatus);
     }
     $this->entityManager->flush();
 }
コード例 #2
0
ファイル: Mailer.php プロジェクト: ttibensky/EmailBundle2
 /**
  * @param ProcessedOutboundMessage $processedMessage
  * @throws MailSystemException
  */
 protected function scheduleProcessedMessage(ProcessedOutboundMessage $processedMessage)
 {
     $sendAt = $processedMessage->getStorableMessage()->getScheduledSendTime();
     $result = $this->mailSystem->scheduleMessage($processedMessage->getUniqueOutboundMessage(), $sendAt);
     $this->handleMailSystemResult($result, $processedMessage);
 }