From 07f5140771388c9e0c8a99b0dd2e5d950bdb173b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 14 Oct 2021 15:16:42 +1100 Subject: moving h-source subdir out. --- .../lib/classes/Swift/Plugins/ReporterPlugin.php | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100755 External/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php (limited to 'External/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php') diff --git a/External/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php b/External/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php new file mode 100755 index 0000000..1beac5b --- /dev/null +++ b/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