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