I am not sure what and when it happened, and if this has something to do with Forms 2.0, but the tell-a-friend form on my grav installation does not work any more. Once the fields are filled and the "Send" button is clicked, it just reloads the page and the email is not sent. Formerly it properly sent the email and showed the configured message.
I did not change anything in my installation since it was still working, I only kept my grav installation and its plugins up-to-date. I do not use a separate file for the form, nor do I use a separate "thankyou" page, I do it all from the main page file. The form is configured like this and is just displayed at the bottom of the page:
form:
name: tell-a-friend
fields:
-
name: sender_name
label: 'Your Name'
placeholder: 'Enter Your Name'
type: text
validate:
required: true
-
name: friend_name
label: 'Your Friend's Name'
placeholder: 'E nter Your Friend's Name'
type: text
validate:
required: true
-
name: friend_email
label: 'Your Friend's Email Address'
placeholder: 'Enter Your Friend's Email Address'
type: email
validate:
required: true
buttons:
-
type: submit
value: Send
process:
-
email:
to: '{{ form.value.friend_email }}'
bcc: '{{ config.plugins.email.from }}'
subject: 'TeslaBargain.com - Recommended by {{ form.value.sender_name|e }}'
body: 'Hello {{ form.value.friend_name|e }},</br></br>{{ form.value.sender_name|e }} would like to recommend our website to you:<h1><a href="http://teslabargain.com">http://TeslaBargain.com</a></h1>Check it out now!</br></br>--</br>Tesla Bargain - This Is How You Get Your Tesla Motors Discount'
-
message: 'Thank you for your recommendation!'