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