'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/…