Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Contact form not sending any emails and not open up thankyou page

Started by Frankenstein 7 years ago · 1 replies · 526 views
7 years ago

Hi,

trying to get a working contact form but their is any little issue why it isnt working.

So i installed recaptcha contactform plugin, entered my website and secret key - saved. After this i configured the email plugin with to and from address, also changed sendmail type to smtp and filled in the smtp settings for the mailbox.

Then i created the new site with following in frontmatter:

YAML
title: Kontakt
author: 'My Name'
date: '23:52 03-11-2019'
form:
    name: kontakt
    fields:
        name:
            label: Name
            placeholder: 'Gib deinen vollständigen Namen ein'
            autocomplete: 'on'
            type: text
            validate:
                required: true
        email:
            label: E-Mail
            placeholder: 'Gib deine E-Mail Adresse ein'
            type: email
            validate:
                required: true
        message:
            label: Nachricht
            placeholder: 'Gib hier deine Nachricht ein'
            type: textarea
            validate:
                required: true
        g-recaptcha-response:
            label: Captcha
            type: captcha
            recaptcha_not_validated: 'Captcha nicht richtig'
    buttons:
        submit:
            type: submit
            value: Absenden
        reset:
            type: reset
            value: Zurücksetzen
    process:
        captcha: true
        save:
            fileprefix: contact-
            dateformat: Ymd-His-u
            extension: txt
            body: '{% include ''forms/data.txt.twig'' %}'
        email:
            subject: '[mysite.tld Kontaktformular] {{ form.value.name|e }}'
            body: '{% include ''forms/data.html.twig'' %}'
        message: 'Vielen Dank für deine Anfrage - ich werde mich schnellstmöglich darum kümmern...'
        display: thankyou

After this, i forked the repo to my local machine, created a folder named "thankyou" as subfolder of "04.Kontakt" where i created a formdata.md with following:

YAML
---
title: E-Mail gesendet
cache_enable: false
process:
    twig: true
---

## Die E-Mail wurde gesendet!

Did u know what i'm doing wrong? Also little problem i didnt get solved: I dont want the thankyou page as sub menu point of "Kontakt"^^

Thanks i advance.

last edited 11/03/19 by Frankenstein
7 years ago

Instead of display in your form process actions, try redirect. If you see a 404, try changing the value to kontact/thankyou instead (I forgot what the redirect path is relative to). Also, try this without the reCaptcha field if you are still having trouble.

Let us know how you go, what you have tried that didn't work, and what the result was.

Good luck!

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 104 18 hours ago
General · by pamtbaau, 23 hours ago
1 88 22 hours ago
General · by Andy Miller, 1 day ago
0 53 1 day ago
General · by Marcel, 12 months ago
6 381 5 days ago
General · by Duc , 6 days ago
3 69 6 days ago