I used a contact from before with Kirby 2 and 3 and was able to make it work on a one-pager.
– Changed the controller to home.php
(inlcuding adding the email information)
– changed the $data to $form (data is already used for the sections)
– configured the smtp server and email in config.php
– email templates are present
– $form, $alert and $success are also passed into the snippet
What else might I be missing?
The website/contact page also does not send, only gives a positive response.
It would be helpful if you post the complete code.
Can you elaborate what you mean? Is there a separate contact page with the form? Or is the form on home or both?
Dear @pixelijn , thanks for your response.
Yes I added a seperate template with the contact form, to see if that would work.
The contact form on a sub-page is 100% according to the cookbook.
Only with the added email configuration.
The page shows the $success message, but nothing is sent.
[EDIT] the contact form on the subpage sends now.
Only the omepage does not work yet.
What exactly does not work? Where is the controller now? Note that the forms `action` attribute needs to point to the page where you have the controller.
The form is pointing to the front page.
I removed the section ID (#contact), but it still does not work
<form method="post" action="<?= $page->url() ?>">
I finally got it to work, by removing the action:
<form method="post">