| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function send(string $subject, string $template, $mailData, string $to, String $from = null):bool |
||
| 26 | { |
||
| 27 | if ($from === null){ |
||
| 28 | $from = getenv('ADMIN_EMAIL'); |
||
| 29 | } |
||
| 30 | |||
| 31 | $message = (new \Swift_Message($subject)) |
||
| 32 | ->setFrom($from) |
||
| 33 | ->setTo($to) |
||
| 34 | ->setBody( |
||
| 35 | $this->templating->render( |
||
| 36 | $template, |
||
| 37 | ['mailData' => $mailData] |
||
| 38 | ), |
||
| 39 | 'text/html' |
||
| 40 | ); |
||
| 41 | return $this->mailer->send($message)>0; |
||
| 42 | |||
| 45 | } |