1 | <?php |
||
11 | class Email |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | protected $from = []; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $to = []; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $subject; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $headers = []; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $text = ''; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $html = ''; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $tag; |
||
48 | |||
49 | /** |
||
50 | * Set 'from' with name and email |
||
51 | * |
||
52 | * @param string $name Name |
||
53 | * @param string $email Email address |
||
54 | */ |
||
55 | 3 | public function setFrom(string $name, string $email) |
|
70 | |||
71 | /** |
||
72 | * Get 'from' array with name and email |
||
73 | * |
||
74 | * @return array |
||
75 | */ |
||
76 | 1 | public function getFrom(): array |
|
80 | |||
81 | /** |
||
82 | * Set 'to' with name and email for 'to', 'cc' or 'bcc' |
||
83 | * |
||
84 | * @param string $type To type: 'to', 'cc' or 'bcc' |
||
85 | * @param string $name Name |
||
86 | * @param string $email Email address |
||
87 | */ |
||
88 | 4 | public function setTo(string $type, string $name, string $email) |
|
108 | |||
109 | /** |
||
110 | * Get 'to' array with type, name and email |
||
111 | * |
||
112 | * @return array |
||
113 | */ |
||
114 | 1 | public function getTo(): array |
|
118 | |||
119 | /** |
||
120 | * Set message subject |
||
121 | * |
||
122 | * @param string $subject Message subject |
||
123 | */ |
||
124 | 1 | public function setSubject(string $subject) |
|
128 | |||
129 | /** |
||
130 | * Get message subject |
||
131 | * |
||
132 | * @return string Message subject |
||
133 | */ |
||
134 | 1 | public function getSubject(): string |
|
138 | |||
139 | /** |
||
140 | * Set message header |
||
141 | * |
||
142 | * @param string $header Header name |
||
143 | * @param string $value Header value |
||
144 | */ |
||
145 | public function setHeader(string $header, string $value) |
||
149 | |||
150 | /** |
||
151 | * Get message headers |
||
152 | * |
||
153 | * @return array Message headers |
||
154 | */ |
||
155 | public function getHeaders(): array |
||
159 | |||
160 | /** |
||
161 | * Set message body HTML version |
||
162 | * |
||
163 | * @param string $html Message body HTML version |
||
164 | */ |
||
165 | 1 | public function setHtml(string $html) |
|
169 | |||
170 | /** |
||
171 | * Get message body HTML version |
||
172 | * |
||
173 | * @return string Message body HTML version |
||
174 | */ |
||
175 | 1 | public function getHtml(): string |
|
179 | |||
180 | /** |
||
181 | * Set message body text version |
||
182 | * |
||
183 | * @param string $text Message body text version |
||
184 | */ |
||
185 | 1 | public function setText(string $text) |
|
189 | |||
190 | /** |
||
191 | * Get message body text version |
||
192 | * |
||
193 | * @return string Message body text version |
||
194 | */ |
||
195 | 1 | public function getText(): string |
|
199 | |||
200 | /** |
||
201 | * Set message tag |
||
202 | * |
||
203 | * @param string $tag Message tag |
||
204 | */ |
||
205 | 1 | public function setTag($tag) |
|
209 | |||
210 | /** |
||
211 | * Get message tag |
||
212 | * |
||
213 | * @return string Message tag |
||
214 | */ |
||
215 | 1 | public function getTag() |
|
219 | } |
||
220 |