1 | <?php |
||
20 | final class ManipulatorPlugin implements \Swift_Events_SendListener |
||
21 | { |
||
22 | /** |
||
23 | * @var EngineInterface |
||
24 | */ |
||
25 | private $templating; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $prependSubject; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private $prependBodyTemplate; |
||
36 | |||
37 | /** |
||
38 | * @var string The original subject before manipulations |
||
39 | */ |
||
40 | private $originalSubject; |
||
41 | |||
42 | /** |
||
43 | * @var string The original body before manipulations |
||
44 | */ |
||
45 | private $originalBody; |
||
46 | |||
47 | /** |
||
48 | * @var \Swift_Mime_Message The message that was last replaced |
||
49 | */ |
||
50 | private $lastMessage; |
||
51 | |||
52 | /** |
||
53 | * @param EngineInterface $templating |
||
54 | * @param string $prependSubject |
||
55 | * @param string $prependBodyTemplate |
||
56 | */ |
||
57 | 10 | public function __construct(EngineInterface $templating, $prependSubject, $prependBodyTemplate) |
|
63 | |||
64 | 10 | public function beforeSendPerformed(\Swift_Events_SendEvent $event) |
|
91 | |||
92 | /** |
||
93 | * @param Swift_Events_SendEvent $event |
||
94 | */ |
||
95 | 10 | public function sendPerformed(Swift_Events_SendEvent $event) |
|
99 | |||
100 | /** |
||
101 | * Restore a changed message back to its original state. |
||
102 | * |
||
103 | * @param \Swift_Mime_Message $message |
||
104 | */ |
||
105 | 10 | private function restoreMessage(\Swift_Mime_Message $message) |
|
121 | } |
||
122 |