I’m interested in setting config options from the panel, in this case I want to allow the user to edit the email transport settings in config.php:
'email' => [
'transport' => [
'type' => 'smtp',
'host' => 'smtp.domain.com',
'port' => 587,
'security' => true,
'auth' => true,
'username' => 'email@domain.com',
'password' => 'mypasswordisbad'
]
]
Given that the kirby() object is not availabile at this point, how do I set/override config options with values set in the panel? This code runs in a snippet that handles the route for sending email fulfilment?
I effectively want to do something like this:
$kirby = kirby();
$email = $kirby->site()->find('email-settings');
'email' => [
'transport' => [
'type' => 'smtp',
'host' => (string)$email->host(),
'port' => (string)$email->port(),
'security' => (string)$email->security(),
'auth' => (string)$email->auth(),
'username' => (string)$email->username(),
'password' => (string)$email->password()
]
]
Thanks for your help.