Documentation:WordPress/Plugins/Gravity Forms

From UBC Wiki
Jump to navigation Jump to search

Gravity Forms can be used to create online forms that site visitors can fill out and an email notification will be sent to the author each time a form is submitted. An example of such a form could ask users to fill out information for an upcoming event.

Important Notice

When using Gravity Forms, do not store/collect any sensitive information. Sensitive information includes student numbers, CWL information, and private personal information. Furthermore, please don't use Gravity Forms for mission-critical information; even though we keep database backups, data loss still might occur.

Form Setup

Log in to your site, if you haven't already done so.

Activate Gravity Forms

  1. Select Dashboard -> Plugins and scroll down to Gravity Forms. On the right, there should be a link to activate the plugin for your site (Enabling Plugins).
  2. A new menu item should appear in the menu bar found on the left side called Forms.

Add a New Form

  1. Go to Dashboard -> Forms -> New Form.
  2. Create your form. Check out this video: Using Gravity Forms (video duration 4:23 min).
  3. Save the form.

Optional: Confirmation Notice

  1. Go to Dashboard -> Forms -> Edit Forms and select the form you wish to change
  2. Click on the "Form Settings" selection in the gray header menu
  3. Select the "Confirmation" tab and edit the confirmation text field
    • If you also wish to add any of the information submitted through the form (ex: name):
      1. Select the "Text" radio button on the "Confirmation" tab
      2. Enter the text that you'd like to precede the form item (name example: "Thank you, ")
      3. Select the form item you'd like to have appear in the confirmation message from the "Insert from field" dropdown
        • Your message in the text field should look similar to this: "Thank you, {Name (First):3.3}"
  4. Alternately, you can also link to an internal or external page upon confirmation by selecting the "Page" or "Redirect" radio button respectively

Embed the form onto a page

  1. Either create a new Page or edit an existing Page: Dashboard -> Pages -> New Page or Dashboard -> Pages -> Pages.
  2. Add the form to the page. Use the gray button between the page title and page body. Note: This is shown in the video above.
  3. Save the Page.

Receive emails from the form

  1. Go to Dashboard -> Forms -> Edit Forms.
  2. Mouse over the name of the form you just created. You should be able to see a "Notifications" link appear below your form's name. Click it.
  3. Under the "Notification to Administrator" heading select the "Enable email notification to administrators" checkbox and fill out the form.
  4. Scroll down and save the form.

Test the form

  1. Go to the page that you just created and fill out your form. Check that you received an email with the information you entered.
  2. Check if the form has a new entry. Go to Dashboard -> Forms -> Edit Forms and check the Entries column, or go to Dashboard -> Forms -> Entries and select the form you just created.

Add reCAPTCHA(optional)

Any web form showing on your site without protection has the potential to cause spams on daily basis. It is recommended to install Google reCAPTCHA for sites on UBC CMS that uses Gravity Forms.

  1. To start using reCAPTCHA, you need to sign up for an API key pair for your site. Under reCAPTCHA type, please choose reCAPTCHA V3. Under domains, If your site has not been domain mapped yet, please add the URL that provided by UBC CMS team after the site creation. Eg, ctlt-test-2021.sites.olt.ubc.ca. If your site has been domain mapped, please make sure to add both the URL provided by CMS team and the primary domain that your site is currently using. Once all the information are correctly filled on the page, please click the submit button. You will then receive a pair of 'Site Key' and 'Secret Key' from Google.
  2. Login to your site's Dashboard an go to 'Plugins'. Search for 'Gravity Forms reCAPTCHA Add-On' and activate it.
  3. Go to Dashboard -> Forms -> Settings. Under 'reCAPTCHA' tab and below 'reCAPTCHA v3' section. Paste in the key pair received from step 1) and click 'Save Settings' button at the very bottom of the page.

Troubleshooting

Solutions to common Gravity Forms problems:

If you didn't get the entry email

Wait a bit, it might take up to half an hour to get the email. Check your spam to make sure it didn't go in there.

Do Gravity Forms support submission preview?

Gravity Forms do not support submission preview. According to this post, the submission preview feature was supposed to be part of the 1.3 release.

Tips

Conditional shortcode with Gravity Forms:

https://gravitywiz.com/gravity-forms-conditional-shortcode/

Sample Usage: Show Content Only if Value Exists

[gravityforms action="conditional" merge_tag="{My Field:1}" condition="isnot" value=""]<br />
My Field Label: {My Field:1}<br />
[/gravityforms]

See Also

Gravity Form FAQ's

Vendor Documentation