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

'Add a contact form'

Started by Muut Archive 11 years ago · 9 replies · 569 views
11 years ago

Hi there ♪

I have a Contact form following the Add a contact Form documentation.

It was working well until recently: whatever I do, when the form is sent (pushing button > 'Submit') I egt the screen 'There was an error please try again'.

I have reinstalled plugins email and form
I don't know why it's not working anymore because I haven't touch anything directly.

I therefore wonder if it is not the update to 1.0.0.RC5?

Please help.

For information
Here is the header of the form.md file:

YAML
title: contact

form:
    name: contact

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

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

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

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

    process:
        - email:
            subject: "[Site Contact Form] {{ 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' %}"
        - message: Thank you for getting in touch!
        - display: thankyou

Here is the header of fordata.md file of folder thank you:

YAML
title: Thank you
robots: 'noindex, nofollow'
cache_enable: false
process:
    twig: true

Here is the email.yaml file (informationss are accurate)

YAML
enabled: true
from: '[email protected]'
to: '[email protected]'
mailer:
  engine: mail
  smtp:
    server: ssl0.ovh.net
    port: 465
    encryption: 'tls'
    user: '[email protected]'
    password: '3s1lambert4'
  sendmail:
    bin: '/usr/sbin/sendmail'

Here is the form.yaml

TXT
enabled: true

Here is the form.htm.twig of form plugin default:

TWIG

{% if form.message %}<div class="alert">{{ form.message }}</div>{% endif %}

<form name="{{ form.name }}"
      action="{{ form.action ? base_url ~ form.action : page.url }}"
      method="{{ form.method|upper|default('POST') }}">
{% for field in form.fields %}
    {% set value = form.value(field.name) %}
    <div>
        {% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
    </div>
{% endfor %}

    <div class="buttons">
    {% for button in form.buttons %}
        <button class="{{ button.classes|default('button') }}" type="{{ button.type|default('submit') }}">{{ button.value|default('Submit') }}</button>
    {% endfor %}
    </div>

  {{ nonce_field('form', 'form-nonce') }}
</form>
---
11 years ago

Thank you very much ♪

I am trying now and come back to you as soon as possible ☆

11 years ago

Unfortunaletly, I changed everything as expected, but nochange: I submit the 'test' then I have the error message... (see attached picture...)
[What I can't explain ... it's that it was working ... and did not touched anything... until this] Capture
What can I do now ... any suggestions ?

11 years ago

Can you send me your user/ folder privately? (use Gitter)

11 years ago

P.s. don't post your passwords in public!

11 years ago

Sorry but
How do you use Gitter to send it?
How can I erase my password?

11 years ago

Hi,
i got the same problem, after submit i get "Oops there was a problem, please check your input and submit the form again."
Did you find a solution?

11 years ago

I added this line and it works now, thank you so much!

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1350 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4061 9 years ago
Archive · by Muut Archive, 9 years ago
1 2948 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago