Total Complexity | 5 |
Total Lines | 64 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
15 | class SwiftMailer implements Mailer |
||
16 | { |
||
17 | |||
18 | use Configurable; |
||
19 | use Injectable; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | * @config |
||
24 | */ |
||
25 | private static $swift_plugins = array( |
||
|
|||
26 | SwiftPlugin::class, |
||
27 | ); |
||
28 | |||
29 | /** |
||
30 | * @var Swift_Mailer |
||
31 | */ |
||
32 | private $swift; |
||
33 | |||
34 | /** |
||
35 | * @param Email $message |
||
36 | * @return bool Whether the sending was "successful" or not |
||
37 | */ |
||
38 | public function send($message) |
||
39 | { |
||
40 | $swiftMessage = $message->getSwiftMessage(); |
||
41 | $failedRecipients = array(); |
||
42 | $result = $this->sendSwift($swiftMessage, $failedRecipients); |
||
43 | $message->setFailedRecipients($failedRecipients); |
||
44 | |||
45 | return $result != 0; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param Swift_Message $message |
||
50 | * @param array $failedRecipients |
||
51 | * @return int |
||
52 | */ |
||
53 | protected function sendSwift($message, &$failedRecipients = null) |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return Swift_Mailer |
||
60 | */ |
||
61 | public function getSwiftMailer() |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * @param Swift_Mailer $swift |
||
68 | * @return $this |
||
69 | */ |
||
70 | public function setSwiftMailer($swift) |
||
81 |