getgrav / getgrav/grav-plugin-form

Contact form doesn't send the message and reload the page

Open
#403 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
64
Forks
80
Avg merge
10h 13m
Merged PRs (30d)
9

Description

Hi,

I try to implement a contact form on my one-page site. (modular page)

My folder structure for the form is :
```
--user
----pages
------01.home
--------modular.md
--------_form
-----------form.md
```

The content of **modular.md** is :

```

title: MG
menu: Accueil
onpage_menu: true
body_class: index
header_class: alt
content:
items: @self.modular
order:
by: default
dir: asc
custom:
- _showcase
- _callout
- _pricing
- _features
- _diplomes
- _screenshots
- _form

```

The content of **form.md** is :

```
title: Contact Form
routable: false
cache_enabled: false
form:
action: /home
name: contact
refresh_prevention: true

fields:
name:
label: Name
placeholder: Enter your name
autocomplete: on
type: text
validate:
required: true

email:
label: Email
placeholder: Enter your email address
type: email
validate:
required: true

message:
label: Message
placeholder: Enter your message
type: textarea
validate:
required: true

buttons:
submit:
type: submit
value: Submit
reset:
type: reset
value: Reset

process:
captcha: false
save:
fileprefix: contact-
dateformat: Ymd-His-u
extension: txt
body: "{% include 'forms/data.txt.twig' %}"
email:
subject: "[Site Contact Form] {{ form.value.name|e }}"
body: "{% include 'forms/data.html.twig' %}"
from: "{{ config.plugins.email.from }}"
from_name: "{{ config.plugins.email.from_name }}"
to: "{{ config.plugins.email.to }}"
to_name: "{{ config.plugins.email.to_name }}"
content_type: 'text/plain'
process_markdown: true
reset: true
message: 'Votre message a bien été envoyé.'

```

The actual behavior by clicking on the SUBMIT button is :
- no message sent
and
- the one-page reload

The email plugin is correctly configured (with Google Email settings) and after tests of the plugin, mails are well sent.

But impossible to send via the contact form.

Someone could help me with this issue?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.