Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function actionMail($to, $name = 'Foo') |
||
15 | { |
||
16 | $mailer = Yii::$app->getMailer(); |
||
17 | $sent = $mailer->compose('hello', ['name' => $name]) |
||
18 | ->setTo($to) |
||
19 | ->setFrom(Yii::$app->get('settingManager')->get('mailer.username')) |
||
20 | ->setSubject('Hello') |
||
21 | ->send(); |
||
22 | if (!$sent) { |
||
23 | $this->stdout('Send failure' . PHP_EOL); |
||
24 | return; |
||
25 | } |
||
26 | |||
27 | $this->stdout('Sent successfully' . PHP_EOL); |
||
28 | } |
||
37 |