Mail Template not changing


 'mailer' => [

            'class' => 'yii\swiftmailer\Mailer',

            'useFileTransport' => false,

            'viewPath' => "@common/mail",

            'transport' => [

                'class' => 'Swift_SmtpTransport',

                'host' => 'host',

                'username' => 'name',

                'password' => '***',

                'port' => '25',

                'encryption' => 'tls'

            ],

        ],


Yii::$app->mailer->compose('layouts/othertemplates', ['content' => 'something'])

  ->setFrom([Yii::$app->params['adminEmail'] => 'Test Mail'])

  ->setTo('receiver@something.com')

  ->setSubject('This is a test mail ')

  ->send();

I have several templates in layouts/ but no matter what i chose during send, it will still send html.php (first template i edited)

another thing is if I input template that does not exist, it will return error file not found, while if I did not put in necessary parameters it will also point out that variables from selected template are missing

any thoughts?

full path of template folder: common/mail/layouts/…

structure


emails

├───layouts  <--- SET IN CONFIG IF USED, use $content to echo content, $message is mail message class

│       html.php

│       text.php

│

└───notification

        html.php

        text.php

config


	'components' => [

		'mailer' => [

...

			'htmlLayout' => 'layouts/html',

			'textLayout' => 'layouts/text',

		],

controller usage




		$e = \Yii::$app->mailer->compose(

			['html' => 'notification/html', 'text' => 'notification/text']...);

 OR

                $e = \Yii::$app->mailer->compose(''notification');