1 | <?php |
||
8 | class Email |
||
9 | { |
||
10 | /** |
||
11 | * @var Template |
||
12 | */ |
||
13 | public $template; |
||
14 | |||
15 | /** |
||
16 | * @var Utility |
||
17 | */ |
||
18 | public $utility; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $attachments; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $headers; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $message; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $subject; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $to; |
||
44 | |||
45 | public function __construct( Template $template, Utility $utility ) |
||
50 | |||
51 | /** |
||
52 | * @return Email |
||
53 | */ |
||
54 | public function compose( array $email ) |
||
71 | |||
72 | /** |
||
73 | * @param bool $plaintext |
||
74 | * |
||
75 | * @return string|null |
||
76 | */ |
||
77 | public function read( $plaintext = false ) |
||
83 | |||
84 | /** |
||
85 | * @return bool|null |
||
86 | */ |
||
87 | public function send() |
||
103 | |||
104 | /** |
||
105 | * @return array |
||
106 | */ |
||
107 | protected function buildHeaders( array $email ) |
||
128 | |||
129 | /** |
||
130 | * @return string |
||
131 | */ |
||
132 | protected function buildHtmlMessage( array $email ) |
||
145 | |||
146 | /** |
||
147 | * @param string $message |
||
148 | * |
||
149 | * @return string |
||
150 | */ |
||
151 | protected function buildPlainTextMessage( $message ) |
||
155 | |||
156 | /** |
||
157 | * @param string $message |
||
158 | * |
||
159 | * @return string |
||
160 | */ |
||
161 | protected function filterHtml( $message ) |
||
170 | |||
171 | /** |
||
172 | * @return string |
||
173 | */ |
||
174 | protected function getDefaultFrom() |
||
181 | |||
182 | /** |
||
183 | * @return array |
||
184 | */ |
||
185 | protected function normalize( $email ) |
||
207 | |||
208 | /** |
||
209 | * @return void |
||
210 | */ |
||
211 | protected function reset() |
||
219 | |||
220 | /** |
||
221 | * @param string $templatePath |
||
222 | * |
||
223 | * @return void|string |
||
224 | */ |
||
225 | protected function renderTemplate( $templatePath, array $args = [] ) |
||
240 | |||
241 | /** |
||
242 | * @param string $template |
||
243 | * |
||
244 | * @return string |
||
245 | */ |
||
246 | protected function renderTemplateString( $template, array $args = [] ) |
||
253 | |||
254 | /** |
||
255 | * - remove invisible elements |
||
256 | * - replace certain elements with a line-break |
||
257 | * - replace certain table elements with a space |
||
258 | * - add a placeholder for plain-text bullets to list elements |
||
259 | * - strip all remaining HTML tags |
||
260 | * @return string |
||
261 | */ |
||
262 | protected function stripHtmlTags( $string ) |
||
274 | } |
||
275 |