Hey,
I have been following the cookbook recipe for user registration and although regular emails are working, the ones containing the codes are not being sent.
I am working on a local environment with MAMP and MailHog. When I try to login and request the code, this never arrives to the inbox, but when I send an email following this example, it works.
Here is my config file:
<?php
return [
// 'debug' => true,
// other settings
'email' => [
// see https://getkirby.com/docs/guide/emails#transport-configuration
'transport' => [
'type' => 'smtp',
'host' => 'localhost',
'port' => 1025,
'security' => false
]
],
// see https://getkirby.com/docs/reference/system/options/auth#login-methods
'auth' => [
'methods' => ['code', 'password'],
'challenge' => [
'timeout' => 2 * 60, // 5 minutes
'email' => [
'from' => 'noreply@yourcompany.com',
'fromName' => 'New Registrations Dept.',
'subject' => 'Login code'
]
]
],
'routes' => [
[
'pattern' => 'logout',
'action' => function() {
if ($user = kirby()->user()) {
$user->logout();
}
go('login');
}
]
],
];
?>
Any idea why it might not be working?