TYPO3  7.6
ReporterPlugin.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of SwiftMailer.
5  * (c) 2004-2009 Chris Corbyn
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10 
17 {
23  private $_reporter;
24 
30  public function __construct(Swift_Plugins_Reporter $reporter)
31  {
32  $this->_reporter = $reporter;
33  }
34 
39  {
40  }
41 
47  public function sendPerformed(Swift_Events_SendEvent $evt)
48  {
49  $message = $evt->getMessage();
50  $failures = array_flip($evt->getFailedRecipients());
51  foreach ((array) $message->getTo() as $address => $null) {
52  $this->_reporter->notify(
53  $message, $address, (array_key_exists($address, $failures)
56  );
57  }
58  foreach ((array) $message->getCc() as $address => $null) {
59  $this->_reporter->notify(
60  $message, $address, (array_key_exists($address, $failures)
63  );
64  }
65  foreach ((array) $message->getBcc() as $address => $null) {
66  $this->_reporter->notify(
67  $message, $address, (array_key_exists($address, $failures)
70  );
71  }
72  }
73 }