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


PHP Swift_Events_SendEvent::getFailedRecipients方法代碼示例

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


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

示例1: sendPerformed

 /**
  * Part of the interface which is notified when a message has been sent.
  * @param Swift_Events_SendEvent
  */
 public function sendPerformed(Swift_Events_SendEvent $e)
 {
     $recipients = $e->getRecipients();
     $failed = $e->getFailedRecipients();
     $it = $recipients->getIterator("to");
     while ($it->hasNext()) {
         $it->next();
         $address = $it->getValue();
         $pass = !in_array($address->getAddress(), $failed);
         $this->getView()->paintResult($address->getAddress(), $pass);
     }
     $it = $recipients->getIterator("cc");
     while ($it->hasNext()) {
         $it->next();
         $address = $it->getValue();
         $pass = !in_array($address->getAddress(), $failed);
         $this->getView()->paintResult($address->getAddress(), $pass);
     }
     $it = $recipients->getIterator("bcc");
     while ($it->hasNext()) {
         $it->next();
         $address = $it->getValue();
         $pass = !in_array($address->getAddress(), $failed);
         $this->getView()->paintResult($address->getAddress(), $pass);
     }
 }
開發者ID:auphau,項目名稱:joyreactor,代碼行數:30,代碼來源:VerboseSending.php

示例2: sendPerformed

 /**
  * Invoked immediately after the Message is sent.
  *
  * @param \Swift_Events_SendEvent $evt
  */
 public function sendPerformed(\Swift_Events_SendEvent $evt)
 {
     $result = $evt->getResult();
     $failed_recipients = $evt->getFailedRecipients();
     $message = $evt->getMessage();
     if ($result === \Swift_Events_SendEvent::RESULT_SUCCESS) {
         $level = $this->levels['sendPerformed.SUCCESS'];
     } else {
         $level = $this->levels['sendPerformed.NOT_SUCCESS'];
     }
     $this->log($level, 'MESSAGE (sendPerformed): ', array('result' => $result, 'failed_recipients' => $failed_recipients, 'message' => $message->toString()));
 }
開發者ID:gcrico,項目名稱:swift-mailer-psr-logger-plugin,代碼行數:17,代碼來源:SwiftMailerPsrLoggerPlugin.php

示例3: sendPerformed

 /**
  * Invoked immediately after the Message is sent.
  * @param Swift_Events_SendEvent $evt
  */
 public function sendPerformed(Swift_Events_SendEvent $event)
 {
     $this->logger->add(sprintf("Sent Emails, Failed Recipients: ", join(', ', $event->getFailedRecipients())));
 }
開發者ID:openbuildings,項目名稱:html-email,代碼行數:8,代碼來源:Fullloggerplugin.php

示例4: sendPerformed

 /**
  * Invoked immediately after the Message is sent.
  * @param Swift_Events_SendEvent $evt
  */
 public function sendPerformed(Swift_Events_SendEvent $evt)
 {
   $message = $evt->getMessage();
   $failures = array_flip($evt->getFailedRecipients());
   foreach ((array) $message->getTo() as $address => $null)
   {
     $this->_reporter->notify(
       $message, $address, (array_key_exists($address, $failures)
       ? Swift_Plugins_Reporter::RESULT_FAIL
       : Swift_Plugins_Reporter::RESULT_PASS)
       );
   }
   foreach ((array) $message->getCc() as $address => $null)
   {
     $this->_reporter->notify(
       $message, $address, (array_key_exists($address, $failures)
       ? Swift_Plugins_Reporter::RESULT_FAIL
       : Swift_Plugins_Reporter::RESULT_PASS)
       );
   }
   foreach ((array) $message->getBcc() as $address => $null)
   {
     $this->_reporter->notify(
       $message, $address, (array_key_exists($address, $failures)
       ? Swift_Plugins_Reporter::RESULT_FAIL
       : Swift_Plugins_Reporter::RESULT_PASS)
       );
   }
 }
開發者ID:nationalfield,項目名稱:symfony,代碼行數:33,代碼來源:ReporterPlugin.php


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