From 232aa1924c8c0f10d87b210b46c9f061af5c844c Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 17 Oct 2010 13:29:57 +0000 Subject: added files --- .../lib/classes/Swift/Plugins/ReporterPlugin.php | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 h-source/External/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php (limited to 'h-source/External/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php') diff --git a/h-source/External/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php b/h-source/External/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php new file mode 100644 index 0000000..1beac5b --- /dev/null +++ b/h-source/External/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php @@ -0,0 +1,82 @@ +_reporter = $reporter; + } + + /** + * Not used. + */ + public function beforeSendPerformed(Swift_Events_SendEvent $evt) + { + } + + /** + * 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) + ); + } + } + +} -- cgit v1.2.3