title: Yii2 email template problems
body: <p>Hello I have two problems with email creation.</p>
  
  <p>the first is that the footer is duplicated:</p>
  
  <pre><code>&lt;div class="footer"&gt;With kind regards, &lt;?= Yii::$app-&gt;name ?&gt; team&lt;/div&gt;
  </code></pre>
  
  <p>Printing two times the same text</p>
  
  <p>the second is about variables:</p>
  
  <pre><code>Yii::$app-&gt;mailer-&gt;compose('@app/mail/layouts/html', 
                                  ['content' =&gt; $text,
                                  'name'=&gt;'the name',
  </code></pre>
  
  <p>and in view template I just try to get $name</p>
  
  <pre><code>$name
  </code></pre>
  
  <p>and the error is:</p>
  
  <pre><code>Undefined variable: name
  </code></pre>
  
  <p>The same happen with $image but not with $content</p>
  
  <p>I use swiftmailer and this is my confuguration:</p>
  
  <pre><code>'mailer' =&gt; [
          'class' =&gt; 'yii\swiftmailer\Mailer',
          // send all mails to a file by default. You have to set
          // 'useFileTransport' to false and configure a transport
          // for the mailer to send real emails.
          'useFileTransport' =&gt; true,
      ],
  </code></pre>
  
  <p>useFileTransport is set true but i think is not problem</p>
  
  <p>this is the complete code for send email</p>
  
  <pre><code> Yii::$app-&gt;mailer-&gt;compose('@app/mail/layouts/html', 
                                  ['content' =&gt; $text,
                                  'name'=&gt;'the name',
                                  'image' =&gt; 'path/to/images/image.png',
                                  ])
          -&gt;setFrom(Yii::$app-&gt;params['adminEmail'])
          -&gt;setTo($email)
          -&gt;setSubject($subject)  
          -&gt;send();
  </code></pre>
  
  <p>Thank to all</p>
  
  <p>Gabriele</p>