| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 31 | public function send() |
||
| 32 | { |
||
| 33 | $pdfPrinter = new PdfPrinter($this->investment); |
||
| 34 | |||
| 35 | $htmlBody = $this->settings->get(ucfirst($this->type).' Email body', 'InvestformModule', 'textarea')->getValue(); |
||
| 36 | if ($this->type == 'form') { |
||
| 37 | $pdfPrinter->printPdfForm(); |
||
| 38 | $htmlBody = \WebCMS\Helpers\SystemHelper::replaceStatic($htmlBody, array('CONTRACT_PATH'), array(\WebCMS\Helpers\SystemHelper::$baseUrl . 'upload/contracts/' . $this->investment->getHash() . '.pdf')); |
||
| 39 | } else { |
||
| 40 | $pdfPrinter->printPdfContract(false, $this->investment->getInvestmentDate()); |
||
| 41 | $htmlBody = \WebCMS\Helpers\SystemHelper::replaceStatic($htmlBody, array('CONTRACT_PATH'), array(\WebCMS\Helpers\SystemHelper::$baseUrl . 'upload/contracts/' . $this->investment->getContractHash() . '.pdf')); |
||
| 42 | } |
||
| 43 | |||
| 44 | $mail = new Message; |
||
| 45 | $mail->setFrom($this->settings->get('Info email', \WebCMS\Settings::SECTION_BASIC, 'text')->getValue()) |
||
| 46 | ->addTo($this->investment->getEmail()) |
||
| 47 | ->setSubject($this->settings->get(ucfirst($this->type).' Subject', 'InvestformModule', 'text')->getValue()) |
||
| 48 | ->setHTMLBody($htmlBody); |
||
| 49 | |||
| 50 | $mail->send(); |
||
| 51 | } |
||
| 52 | } |
||
| 53 |