Email Contact Form (Controllers and Routes)


I’m using the Cookbook guide to create a simple Email Contact Form. The page (/contact) is being loaded via a custom route set up in my config page.

        'routes' => [
        'pattern' => 'contact',
        'action'  => function () {
          return new Page([
            'slug' => 'contact',
            'template' => 'contact'

And then the controller has the Form Validation, etc. For some reason, the page loads correctly via my contact.php template when the form is blank, but routes to the default template when data has been submitted. Any suggestions?

Same as here: POST request to virtual page

:partying_face: Brilliant, thanks!