User Guide

Plugin installation

If you have already installed the plugin, feel free to move to the next step.

  1. Navigate to Plugins / Add New and search for “RFS Email Verification for Gravity Forms” in the search box.
  2. Once you’ve found the plugin click on “Install Now” and then on “Activate“.

License

In order to use the add-on you need to activate it in plugin global settings. The free version does not require the license and is activated when you activate the plugin.

Global Settings

To access global settings of the add-on:

  1. Go to Forms / Settings / Email Verification


  2. The available settings are:
    • License key – Enter the license key you received after you purchased the plugin in order to activate the add-on.
    • Ajax request helper – Use this in case of any issues with sending the verification code feature.

Configuration

The configuration of the add-on is done on per forms basis. In order to do that, kindly follow these steps:

  1. Go to Forms, next hover the mouse cursor over the “Settings” link and then click on “Email Verification“.


  2. You will be taken to the settings page:


  3. The settings page consists of three groups of settings:

General:

  1. Send Code button text – Add your own text for the button, which generated the verification code and sends an email.
  2. Show resend button (PRO) – Display a “Resend code” button. It will let users to “ask” for another code in case the initial code hasn’t been delivered for any reason.
  3. Resend Code button text (PRO) – Add your own text for the rensed button.
  4. Resend interval (PRO) – This option prevents hitting the resend button multiple times in a row, which would result in sending multiple emails.
  5. Resend interval text (PRO) – Use custom text for the resend interval or leave empty to hide the text.
  6. Code expiry Time (PRO) – By default the verification code expires after 2 minutes. With this setting you can set your own time or disable it. The code will auto expire after submitting the form or reloading the page, regardless of this setting.
  7. Code sent message – verification code field – This message will display below the verification code field after sending the code via email.
  8. Code sent message – email field (PRO) – This message will display below the email field on multi-page form with button display setting set to “Same page as Email field”.

Email:

  1. Email subject – Set your own subject for the email.
  2. Email from – By default site admin email address is used. You can set your own using this setting.
  3. Email message (PRO) – Default value for this field is: “Your verification code is: {verification_code}”. This setting lets you customize the message as well as personalize it using the dynamic merge tags for displaying form fields values, like Name for example.

Multi-page:

  1. Send code button display (PRO) – Display email and verification code fields on different pages of the form.
  2. Send code button behaviour (PRO) – Use this setting with combination with the previous one to automatically go to the next page of the form, after sending the code, for better user experience.

Add Email Verification Code field to the form

In order to add the Email Verification Field to the form, kindly follow these steps:

  1. Go to Forms
  2. Edit an existing form or create a new one
  3. Under “Advanced Fields” section scroll down to “Email Verification Code” field and click on it.
  4. The field will be added to the form. Please note that:
    – The field can only be used once in a form.
    – The field is automatically set as required.
    – The email field will be validated by the add-on in case it is not set as required.
    – In multi-page form the email field must be on the same that the code field or on the previous page.

For Developers

The plugin provides a few helpful hooks and filters for developers:

1. rfs_gf_ev_before_send_code

This hook is fired before the verification code has been sent via email. You can use this to perform custom actions.

Usage

add_action( 'rfs_gf_ev_before_send_code', 'rfswp_ev_before_send_code_callback', 10, 5 );
Code language: PHP (php)

Parameters

  • $form_settings array
    An array containing form email verification settings values.
  • $post_data array
    An array containing request data.
  • $form_id int
    Currently processed form id.
  • $action string
    Action type of currently processed form. Action with the value of “next” refers to “Send code button behaviour” option set to “next” for multi-page forms.
  • $is_resend bool
    True if the “Resend code button” is clicked and the new code is about to be sent.

2. rfs_gf_ev_after_send_code

This hook is fired after the verification code has been sent via email. You can use this to perform custom actions.

Usage

add_action( 'rfs_gf_ev_after_send_code', 'rfswp_ev_after_send_code_callback', 10, 5 );
Code language: PHP (php)

Parameters

  • $form_settings array
    An array containing form email verification settings values.
  • $post_data array
    An array containing request data.
  • $form_id int
    Currently processed form id.
  • $action string
    Action type of currently processed form. Action with the value of “next” refers to “Send code button behaviour” option set to “next” for multi-page forms.
  • $is_resend bool
    True if the “Resend code button” is clicked and the new code has be sent.

3. rfs_gf_ev_form_info

This filter provides the ability to add custom data to the form info array, which contains some useful data of the currently processed form.

Usage

add_filter( 'rfs_gf_ev_form_info', 'rfswp_ev_form_info', 10, 2 );
Code language: PHP (php)

Parameters

  • $form_info array
    An array containing form data required by the add-on.
  • $form array
    Original Gravity Forms array containing the form data

4. rfs_gf_ev_button_html

This filter can be used to modify the “Send code” button html structure or add custom html.

Usage

add_filter( 'rfs_gf_ev_button_html', 'rfswp_ev_button_html', 10, 2 );
Code language: PHP (php)

Parameters

  • $button_html html
    Original Gravity Forms array containing the form data
  • $form_info array
    An array containing form data required by the add-on.

5. rfs_gf_ev_settings

This filter is used to customize the available settings for the add-on, the form Email Verification settings fields. You can add your own group of settings using this filter.

Usage

add_filter( 'rfs_gf_ev_settings', 'rfswp_ev_settings', 10, 1 );
Code language: PHP (php)

Parameters

  • $settings array
    An array of settings groups and fields

6. rfs_gf_ev_global_settings

This filter is used to customize the available global settings for the add-on.. You can add your own group of settings using this filter.

Usage

add_filter( 'rfs_gf_ev_global_settings', 'rfswp_ev_global_settings', 10, 1 );
Code language: PHP (php)

Parameters

  • $settings array
    An array of settings groups and fields

7. rfs_gf_ev_allow_send_email

This filter can be used to prevent the email from being sent, for whatever reason like using your own function to send it.

Usage

add_filter( 'rfs_gf_ev_allow_send_email', 'rfswp_ev_allow_send_email', 10, 4 );
Code language: PHP (php)

Parameters

  • $allow boolean
  • $form_info array
    An array containing current form data.
  • $post_data array
    An array containing request data
  • $is_resend bool
    True if the “Resend code button” is clicked and the new code has be sent.

8. rfs_gf_ev_email_message

This filter can be used to modify the email message or using your custom email template.

Usage

add_filter( 'rfs_gf_ev_email_message', 'rfswp_ev_email_message', 10, 3 );
Code language: PHP (php)

Parameters

  • $message html
  • $form_settings array
    An array containing form email verification settings values.
  • $post_data array
    An array containing request data

9. rfs_gf_ev_email_from_name

This filter can be used to modify the email “from name”, which is a blog name by default.

Usage

add_filter( 'rfs_gf_ev_email_from_name', 'rfswp_ev_email_from_name', 10, 4 );
Code language: PHP (php)

Parameters

  • $from_name string
  • $form_settings array
    An array containing form email verification settings values.
  • $post_data array
    An array containing request data

10. rfs_gf_ev_default_error_messages

This filter is used to customize the default error messages for an email and email verification code fields. These messages will be used if no custom error message is entered in field settings.

Usage

add_filter( 'rfs_gf_ev_default_error_messages', 'rfswp_ev_default_error_messages', 10, 1 );
Code language: PHP (php)

Parameters

  • $error_messages array
    An array of error messages for an email and email verification code fields.