How can i do configuration of emails in admin panel in Symfony? Default i must set this in file factories.yml:
mailer:
class: sfMailer
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
host: localhost
port: 25
encryption: ~
username: ~
password: ~
I would like set host, port, encryption, username and password in admin panel and keep this in my database. So how can i get this data from database if i send mail?
$message = $this->getMailer()->compose(
array('jobeet@example.com' => 'Jobeet Bot'),
$affiliate->getEmail(),
'Jobeet affiliate token',
<<<EOF
Your Jobeet affiliate account has been activated.
Your token is {$affiliate->getToken()}.
The Jobeet Bot.
EOF
);
$this->getMailer()->send($message);
I can get this data from database :) but i dont know how to write in to getMailer().