Hi,
I’ve created a modular page with a contact form in it. The form sends the email OK, but for some reason, it gives a Server Error after it redirects to contact/_contact
Folder structure:
_Contact (form.md)
_showcase
_map
_Contactdetails (some icons, etc. no form)
thankyou
modular.md
modular MD:
---
title: 'Contact Form'
menu: Contact
onpage_menu: false
body_classes: 'modular header-image fullwidth'
form:
name: contact
fields:
- name: name
label: Name
placeholder: Enter your name
size: x-small
autofocus: on
autocomplete: on
type: text
validate:
required: true
- name: Company
label: Company
placeholder: Company
autofocus: on
autocomplete: on
type: text
validate:
required: true
- name: email
label: Email
placeholder: Enter your email address
type: email
validate:
required: true
- name: message
label: Message
placeholder: 'Enter your message'
type: textarea
validate:
required: true
- name: g-recaptcha-response
label: Captcha
type: captcha
recaptcha_site_key: 134
recaptcha_not_validated: 'Captcha not valid!'
validate:
required: true
buttons:
- type: submit
value: Submit
- type: reset
value: Reset
process:
- captcha:
recaptcha_secret: 1234
- email:
from: "{{ config.plugins.email.from }}"
to:
- "{{ config.plugins.email.from }}"
- "{{ form.value.email }}"
subject: "[Website] {{ form.value.name|e }}"
body: "{% include 'forms/data.html.twig' %}"
- save:
fileprefix: feedback-
dateformat: Ymd-His-u
extension: txt
body: "{% include 'forms/data.txt.twig' %}"
- message: Thank you for your message!
- display: thankyou
content:
items: '@self.modular'
order:
by: default
dir: asc
custom:
- _showcase
- _contactdetails
- _map
---