Conditions | 2 |
Paths | 2 |
Total Lines | 28 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function __invoke($comment) |
||
26 | { |
||
27 | $mailerConfig = $this->configService['rb_comment']['email']; |
||
28 | |||
29 | $htmlContent = $comment->content; |
||
30 | $htmlContent .= '<br><br>'; |
||
31 | $htmlContent .= |
||
32 | '<a href="' . $this->serverUrlHelper->__invoke() . $comment->uri . '#rbcomment-' . $comment->id . '">' . |
||
33 | $mailerConfig['context_link_text'] . |
||
34 | '</a>'; |
||
35 | |||
36 | $html = new MimePart($htmlContent); |
||
37 | $html->type = "text/html"; |
||
38 | |||
39 | $body = new MimeMessage(); |
||
40 | $body->setParts([$html]); |
||
41 | |||
42 | $message = new Message(); |
||
43 | $message->addFrom($mailerConfig['from']) |
||
44 | ->setSubject($mailerConfig['subject']) |
||
45 | ->setBody($body); |
||
46 | |||
47 | foreach ($mailerConfig['to'] as $mConfig) { |
||
48 | $message->addTo($mConfig); |
||
49 | } |
||
50 | |||
51 | $this->mailerService->send($message); |
||
52 | } |
||
53 | } |
||
54 |