Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
17 | 1 | public function sendMessage(string $to, string $subject, string $view, array $params = []): bool |
|
18 | { |
||
19 | 1 | $mailer = \Yii::$app->mailer; |
|
20 | |||
21 | 1 | $mailer->viewPath = \Yii::$app->params['helper.mailer.viewpath']; |
|
|
|||
22 | |||
23 | 1 | return $mailer->compose(['html' => $view, 'text' => 'text/' . $view], $params) |
|
24 | 1 | ->setTo($to) |
|
25 | 1 | ->setFrom( |
|
26 | 1 | [\Yii::$app->params['helper.mailer.sender'] => \Yii::$app->params['helper.mailer.sender.name']] |
|
27 | ) |
||
28 | 1 | ->setSubject($subject) |
|
29 | 1 | ->send(); |
|
30 | } |
||
32 |