1 | <?php |
||
35 | class Message implements IMessage { |
||
36 | /** @var Swift_Message */ |
||
37 | private $swiftMessage; |
||
38 | |||
39 | /** |
||
40 | * @param Swift_Message $swiftMessage |
||
41 | */ |
||
42 | public function __construct(Swift_Message $swiftMessage) { |
||
45 | |||
46 | /** |
||
47 | * SwiftMailer does currently not work with IDN domains, this function therefore converts the domains |
||
48 | * FIXME: Remove this once SwiftMailer supports IDN |
||
49 | * |
||
50 | * @param array $addresses Array of mail addresses, key will get converted |
||
51 | * @return array Converted addresses if `idn_to_ascii` exists |
||
52 | */ |
||
53 | protected function convertAddresses($addresses) { |
||
74 | |||
75 | /** |
||
76 | * Set the from address of this message. |
||
77 | * |
||
78 | * If no "From" address is used \OC\Mail\Mailer will use mail_from_address and mail_domain from config.php |
||
79 | * |
||
80 | * @param array $addresses Example: array('[email protected]', '[email protected]' => 'A name') |
||
81 | * @return $this |
||
82 | */ |
||
83 | public function setFrom(array $addresses) { |
||
89 | |||
90 | /** |
||
91 | * Get the from address of this message. |
||
92 | * |
||
93 | * @return array |
||
94 | */ |
||
95 | public function getFrom() { |
||
98 | |||
99 | /** |
||
100 | * Set the Reply-To address of this message |
||
101 | * |
||
102 | * @param array $addresses |
||
103 | * @return $this |
||
104 | */ |
||
105 | public function setReplyTo(array $addresses) { |
||
111 | |||
112 | /** |
||
113 | * Returns the Reply-To address of this message |
||
114 | * |
||
115 | * @return array |
||
116 | */ |
||
117 | public function getReplyTo() { |
||
120 | |||
121 | /** |
||
122 | * Set the to addresses of this message. |
||
123 | * |
||
124 | * @param array $recipients Example: array('[email protected]', '[email protected]' => 'A name') |
||
125 | * @return $this |
||
126 | */ |
||
127 | public function setTo(array $recipients) { |
||
133 | |||
134 | /** |
||
135 | * Get the to address of this message. |
||
136 | * |
||
137 | * @return array |
||
138 | */ |
||
139 | public function getTo() { |
||
142 | |||
143 | /** |
||
144 | * Set the CC recipients of this message. |
||
145 | * |
||
146 | * @param array $recipients Example: array('[email protected]', '[email protected]' => 'A name') |
||
147 | * @return $this |
||
148 | */ |
||
149 | public function setCc(array $recipients) { |
||
155 | |||
156 | /** |
||
157 | * Get the cc address of this message. |
||
158 | * |
||
159 | * @return array |
||
160 | */ |
||
161 | public function getCc() { |
||
164 | |||
165 | /** |
||
166 | * Set the BCC recipients of this message. |
||
167 | * |
||
168 | * @param array $recipients Example: array('[email protected]', '[email protected]' => 'A name') |
||
169 | * @return $this |
||
170 | */ |
||
171 | public function setBcc(array $recipients) { |
||
177 | |||
178 | /** |
||
179 | * Get the Bcc address of this message. |
||
180 | * |
||
181 | * @return array |
||
182 | */ |
||
183 | public function getBcc() { |
||
186 | |||
187 | /** |
||
188 | * Set the subject of this message. |
||
189 | * |
||
190 | * @param $subject |
||
191 | * @return $this |
||
192 | */ |
||
193 | public function setSubject($subject) { |
||
197 | |||
198 | /** |
||
199 | * Get the from subject of this message. |
||
200 | * |
||
201 | * @return string |
||
202 | */ |
||
203 | public function getSubject() { |
||
206 | |||
207 | /** |
||
208 | * Set the plain-text body of this message. |
||
209 | * |
||
210 | * @param string $body |
||
211 | * @return $this |
||
212 | */ |
||
213 | public function setPlainBody($body) { |
||
217 | |||
218 | /** |
||
219 | * Get the plain body of this message. |
||
220 | * |
||
221 | * @return string |
||
222 | */ |
||
223 | public function getPlainBody() { |
||
226 | |||
227 | /** |
||
228 | * Set the HTML body of this message. Consider also sending a plain-text body instead of only an HTML one. |
||
229 | * |
||
230 | * @param string $body |
||
231 | * @return $this |
||
232 | */ |
||
233 | public function setHtmlBody($body) { |
||
237 | |||
238 | /** |
||
239 | * Get's the underlying SwiftMessage |
||
240 | * @return Swift_Message |
||
241 | */ |
||
242 | public function getSwiftMessage() { |
||
245 | |||
246 | /** |
||
247 | * @param string $body |
||
248 | * @param string $contentType |
||
249 | * @return $this |
||
250 | */ |
||
251 | public function setBody($body, $contentType) { |
||
255 | |||
256 | /** |
||
257 | * @param IEMailTemplate $emailTemplate |
||
258 | * @return $this |
||
259 | */ |
||
260 | public function useTemplate(IEMailTemplate $emailTemplate) { |
||
266 | } |
||
267 |