im using Yii2 and i want to config mailer parameters geting the data from db.
Example:
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'enableSwiftMailerLogging' =>true,
'useFileTransport' => false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => $model->getSmtpHost(),
'username' => $model->getSmtpUser(),
'password' => $model->getSmtpPass(),
'port' => $model->getSmtpPort(),
'encryption' => $model->getSmtpEncryption(),
],
]
but from web.php can't call methods from models, i tried but throws a error