1 | <?php |
||
24 | class EmailService |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * Mailmessage |
||
29 | * |
||
30 | * @var \TYPO3\CMS\Core\Mail\MailMessage |
||
31 | */ |
||
32 | protected $mailer = null; |
||
33 | |||
34 | /** |
||
35 | * Sends an e-mail, if sender and recipient is an valid e-mail address |
||
36 | * |
||
37 | * @param string $sender The sender |
||
38 | * @param string $recipient The recipient |
||
39 | * @param string $subject The subject |
||
40 | * @param string $body E-Mail body |
||
41 | * @param string $name Optional sendername |
||
42 | * @param array $attachments Array of files (e.g. ['/absolute/path/doc.pdf']) |
||
43 | * |
||
44 | * @return bool TRUE/FALSE if message is sent |
||
45 | */ |
||
46 | 4 | public function sendEmailMessage($sender, $recipient, $subject, $body, $name = null, $attachments = []) |
|
61 | |||
62 | /** |
||
63 | * Creates a new mail message |
||
64 | * |
||
65 | * @return void |
||
66 | */ |
||
67 | protected function initialize() |
||
71 | |||
72 | /** |
||
73 | * Attaches the given array of files to the email message |
||
74 | * |
||
75 | * @param array $attachments |
||
76 | * @return void |
||
77 | */ |
||
78 | 2 | protected function addAttachments($attachments) |
|
88 | } |
||
89 |