I’m trying to create a registration page for users according to this cookbook recipe: User registration | Kirby CMS
I’ve set up mailhog for testing on my localhost which works when adding this to a page template:
<?php
$kirby->email([
'template' => 'email',
'from' => 'yourcontactform@yourcompany.com',
'to' => 'you@yourcompany.com',
'subject' => 'Let us test if MailHog works',
'data' => [
'text' => 'Here is some dummy text',
]
]);
However I can’t get it to work with the controller from the recipe. It’s not giving any errors but also not receiving any emails in mailhog. My config looks like this:
return [
'debug' => true,
'routes' => [
[
'pattern' => 'logout',
'action' => function() {
if ($user = kirby()->user()) {
$user->logout();
}
go('login');
}
]
],
'email' => [
'transport' => [
'type' => 'smtp',
'host' => 'localhost',
'port' => 1025,
'security' => false
]
],
'auth' => [
'methods' => ['password', 'code']
],
];
How can I get this to work so that I can start testing and using the login?
Alternative question: is there also a recipe where users register with their e-mail and get send a link to set their password?