I’ve created a modular page and followed the instructions indicated in here http://learn.getgrav.org/advanced/forms#using-forms-in-modular-pages
I am able to show the form and the sending emails is working well, then sending emails stopped working when I made another test.
I’m not sure if I made something wrong that I did not spotted immediately.
Here’s my current structure:-
a… I’ve created a modular page and created/used a page file form.html.twig
b… I’ve edited the modular markdown file as per instructions in the documentation and added the following:-
published: true
content:
order:
dir: asc
by: default
items: '@self.modular'
form:
action: /01.home/_contact/thankyou
name: contact-form
fields:
- name: name
label: Name
placeholder: Enter your name *
autocomplete: on
type: text
classes: form-name
- name: email
label: Email
placeholder: Enter your email address *
autocomplete: on
type: email
- name: subject
label: Subject
placeholder: Subject *
autocomplete: on
type: text
- name: message
label: Message
placeholder: Message *
type: textarea
validate:
required: true
- name: g-recaptcha-response
label: Captcha
type: captcha
recatpcha_site_key: 6LdUvhITAAAAANuC4X93GfyDX7LOPa7z68C4ESkV
recaptcha_not_validated: 'Captcha not valid!'
buttons:
- type: submit
value: Submit
- type: reset
value: Reset
process:
- captcha:
recatpcha_secret: 6LdUvhITAAAAAA8FGshD4R5PL7yoCurL6xciXRwQ
- email:
from: "{{ config.plugins.email.from }}"
to:
- "{{ config.plugins.email.from }}"
- "{{ form.value.email }}"
subject: '[Contact form submission] {{ form.value.name|e }}'
body: '{% include ''forms/data.html.twig'' %}'
- save:
fileprefix: contact-
dateformat: Ymd-His-u
extension: txt
body: '{% include ''forms/data.txt.twig'' %}'
- display: thankyou
At my site email configuration, I’ve used something like below configuration:-
Mailer: SMTP
Email from: noreply@domain.com
Email to: myemail@email.com
SMTP server: localhost
SMTP port: 25
SMTP encryption: none
SMTP login name: noreply@domain.com
SMTP password: password
Path to sendmail /usr/sbin/sendmail
Is there something wrong with my structure or is it the email configuration? Please help as I’m trying to work this out for about a day with no luck.