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

Form in modular page not sending EMAIL after SUBMISSION

Started by Muut Archive 10 years ago · 1 replies · 323 views
10 years ago

after the submission in the contact form, the email doesn't send. The yaml goes like this:

menu: Home
content:
order:
dir: asc
by: default
custom:

  • _features
  • _about
  • _contact-us
    items: '@self.modular'
    onpage_menu: true
    form:
    action: /thankyou
    fields:

    YAML
        name: name
        label: Name
        placeholder: 'Name*' 
        autocomplete: 'on'
        type: text
        validate:
            required: true
    -
        name: email
        label: Email
        placeholder: 'Email*'
        autocomplete: 'on'
        type: email
        validate:
            required: true
    -
        name: subject
        label: Subject
        placeholder: 'Subject*'
        autocomplete: 'on'
        type: text
        validate:
            required: true
    -
        name: phone
        label: Phone
        placeholder: 'Phone (Optional)'
        autocomplete: 'on'
        type: text
        validate:
            required: false
    -
        name: message
        label: Message
        placeholder: 'Message*'
        type: textarea
        validate:
            required: true
    -
        name: option
        label: 'Preffered Call time'
        type: checkboxes
        options:
            morning: Morning
            afternoon: Afternoon
            evening: Evening
        validate:
            required: false
    -
        name: g-recaptcha-response
        label: Captcha
        type: captcha
        recatpcha_site_key: 6LdRAxUTAAAAAM5lBUqF-hAjEd4j7CtxFa4N4Fo4
        recaptcha_not_validated: 'Captcha not valid!'
        validate:
            required: true
    

    buttons:

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

    process:

    TWIG
        captcha:
            recatpcha_secret: 6LdRAxUTAAAAAFvS-8FDVBdV7p6o60QSyGwLfu-z
    -
        email:
            from: '{{ config.plugins.email.from }}'
            to: ['{{ config.plugins.email.to }}', '{{ form.value.email }}']
            subject: 'Contact Form Submission from {{ form.value.name|e }}'
            body: '{% include ''forms/data.html.twig'' %}'
    -
        display: /thankyou
    

I am using (modular.htm.twig) for the homepage.
Anyone? Can help me :(

10 years ago

You mentioned modular form, does a normal form page work, or is this problem specific to the modular form?

Did you configure the email plugin? Does it work with SMTP? Try with this debugging hint

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1354 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4065 9 years ago
Archive · by Muut Archive, 9 years ago
1 2953 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago