Is there any way to access your parameters within a mail layout when using the Yii mailer
class? I can access $model
from the view but not the layout.
<?php
$params = array(
"model" => $model
);
$message = Yii::$app->mailer->compose([
'html' => $view.'Html',
'text' => $view,
], $params)
->setFrom("[email protected]")
->setTo($recipient)
->setSubject($subject);
?>
I know that for a standard web view you would set yii\web\View::$params
to access variables in the layout but this doesn't appear to work for the mailer.
Any ideas?