I'm trying to setup different mail settings per environment. Here is my mail component that I'm defining in config/app.php
:
'components' => [
'mailer' => function() {
// Get the stored email settings
$settings = Craft::$app->systemSettings->getEmailSettings();
// Override the transport adapter class
$settings->transportType = craft\mail\transportadapters\Smtp::class;
// Override the transport adapter settings
$settings->transportSettings = [
'host' => 'localhost',
'port' => '1025',
'useAuthentication' => false,
'encryptionMethod' => null,
'timeout' => '10',
];
return craft\helpers\MailerHelper::createMailer($settings);
},
],
How do I ensure this only applies to development environments? Multi-environment doesn't seem to work like it does for config/general.php
and there's no multi-environment example in the relevant documentation. Brandon's Github comment here suggests that this is possible. Thanks.