Configuring Confirmations

Configuring Confirmations

Editing or Creating a ConfirmationConfirmation Settings ReferenceConfirmation Type: TextConfirmation Type: PageConfirmation Type: RedirectChanging the Default Confirmation Message

Upon submitting a form in Gravity Forms, the user will be presented with a message or directed to a new page. By default, this is a simple message letting them know that the form has been successfully submitted and thanking them for their submission. In this article, we will show you how to change your confirmation message, as well as create custom confirmation messages based on the content that is submitted.

Editing or Creating a Confirmation

If you have not yet created a form, review our article on creating forms to get started. If you have a form ready, then access the form confirmations as follows:

Access your form by clicking on Forms from the left side navigation menu, and then clicking on the title of the form that you want to modify the confirmation message for.To access the confirmations for that form, hover over Settings on the top menu, and click on Confirmations.You will see a list of available confirmations. If you want to edit an existing confirmation, click on its title. To add a new confirmation, click the Add New button. Refer to the Confirmations List Page article for more information on available actions for this page.

Animation showing how to access the Confirmations settings page for a form.

Confirmation Settings Reference

When editing a Confirmation, the following settings are available:

SettingDescriptionConfirmation NameTo help identify the confirmation in the confirmation list. Name is not displayed to the user.Confirmation TypeOptions are Text, Page, and Redirect. Se below for more information on each. MessageThis is displayed to the user upon form submission.Conditional LogicConfigure more granular conditions that must be met in order to display this confirmation. The Default Confirmation doesn』t support conditional logic. For more information on conditional logic, see this article.

Confirmation Type: Text

Text confirmations allow you to display a bit of text to the user upon submission. If you need to thank the user for their submission, this is the best and most popular option for doing so.

There』s not much to configuring a standard text notification. Select the Text option, and begin writing your confirmation message in the box below. Use the Add Media button to add an image or video. If you want to disable the auto formatting of the text, enable the checkbox labeled Disable Auto-formatting.

Confirmation Type: Page

With the Page setting within the Confirmation Type options, you will be able to set a page within your site that the user will be sent to upon submitting the form. To configure your confirmation page, use the dropdown labeled Page to select the page you want the user to be delivered to.

With a custom confirmation page option, you may also have the form data sent to the page. For example, if you want the information on the page to change based on the form information submitted, under Pass Field Data via Query String add merge tags to the box. Example:

phone={Phone:1}&email={Email:2}

Confirmation Type: Redirect

If you want the user to be redirected to another location such as an external site upon submitting the form, you may set the Redirect option. To do so, select Redirect as the Confirmation Type, and enter the full URL that you want the user to be redirected to in the Redirect URL field.

Just like the page confirmation type, you can also pass the form information via a query string in the URL. Under Pass Field Data via Query String add merge tags. Next to this field is a Merge Tag Tool {..} to make adding merge tags easier.

Changing the Default Confirmation Message

To display a custom confirmation message, you will need to edit the Default Confirmation or create a new confirmation with conditional logic enabled. The Default Confirmation will be used if the logic fails on additional confirmations. The form needs to always process one confirmation, and therefore the Default Confirmation cannot be deleted, removed, or inactivated.

Therefore, if you want to use the same confirmation for all users submitting the form, customize the Default Confirmation. If you want to show a different confirmation based on conditional logic, add as many new confirmations as you may need and configure conditional logic for them.

For more advanced information on confirmation messages, take a look at our article on confirmation message conditional logic in which you will learn how to display different confirmation messages based on conditions specified about the form content.

Changing Stripe Billing Information

Changing Stripe Billing Information

PrerequisitesVersion 3.4+NotesOlder Versions

This snippet will allow you to change a customer』s billing information that has been stored within Stripe, using a form.
The current snippet is based on the original one provided to us by one of our customers, Shamai Greenfield.
Prerequisites

IMPORTANT: The user must be logged in before submitting any of the forms described below. Otherwise there』s no way to identify the user and associate WordPress and Stripe.com id』s.

To use this snippet, you will need two forms. We』ll call them Form A and Form B.
Form A will contain your standard Stripe subscription form. It creates the customer and the gform_stripe_customer_after_create snippet saves the customer id to the user meta.
Form B will be an additional form that you can use for updating the subscription. It』s used to update the billing info. This would have a product and services feed, and hidden product with at least $0.50. On submission the gform_stripe_customer_id code snippet gets the customer id from the user meta, this will be used to get the customer object which is then used to create the charge object, updating the billing info. The gform_stripe_charge_authorization_only code snippet is then used to prevent the charge being captured.
Version 3.4+
Notes

Payment method must be set to Stripe Credit Card Field.
Due to changes done by Stripe.com to the payment intents API, the card will be saved but not set as default payment method.

// Save the users' Stripe customer ID after a payment is made via a subscription Stripe feed.
add_action( 'gform_stripe_customer_after_create', 'save_stripe_customer_id' );
function save_stripe_customer_id( $customer ) {
gf_stripe()->log_debug( __METHOD__ . '(): Running...' );
if ( is_user_logged_in () ) {
$user_id = get_current_user_id();
gf_stripe()->log_debug( __METHOD__ . '(): Adding customer id ' . $customer->id . ' to user ' . $user_id );
update_user_meta( $user_id, 'stripe_customer_id', $customer->id );
}
}

// Gets the current Stripe customer ID to change the billing details on. Tests if the user has an ID and is signed in.
add_filter( 'gform_stripe_customer_id', 'get_stripe_customer_id' );
function get_stripe_customer_id( $customer_id ) {
gf_stripe()->log_debug( __METHOD__ . '(): Running...' );
if ( is_user_logged_in () && get_user_meta( get_current_user_id(), 'stripe_customer_id', true ) != ''){
$user_id = get_current_user_id();
gf_stripe()->log_debug( __METHOD__ . '(): Getting customer id from user ' . $user_id );
$customer_id = get_user_meta( $user_id, 'stripe_customer_id', true );
gf_stripe()->log_debug( __METHOD__ . '(): Customer id set to: ' . $customer_id );
}
return $customer_id;
}

// Make a form that has a Stripe Product and Services feed, and make sure no payment is made.
add_filter( 'gform_stripe_charge_authorization_only', 'stripe_charge_authorization_only', 10, 2 );
function stripe_charge_authorization_only( $authorization_only, $feed ) {
gf_stripe()->log_debug( __METHOD__ . '(): Running...' );
$feed_name = rgars( $feed, 'meta/feedName' );
// The name associated with the Stripe feed.
if ( $feed_name == 'Update Billing' ) {
gf_stripe()->log_debug( __METHOD__ . '(): Authorization only for Update Billing feed.' );
return true;
}
return $authorization_only;
}

add_filter( 'gform_stripe_charge_pre_create', function( $charge_meta, $feed, $submission_data, $form, $entry ) {
$feed_name = rgars( $feed, 'meta/feedName' );
// The name associated with the Stripe feed.
if ( $feed_name == 'Update Billing' ) {
gf_stripe()->log_debug( 'gform_stripe_charge_pre_create: running for feed ' . rgars( $feed, 'meta/feedName' ) );
$charge_meta['setup_future_usage'] = 'off_session';
}

return $charge_meta;
}, 10, 5 );

Older Versions
// Save the users' Stripe customer ID after a payment is made via a subscription Stripe feed.
add_action( 'gform_stripe_customer_after_create', 'save_stripe_customer_id' );
function save_stripe_customer_id( $customer ) {
GFCommon::log_debug( __METHOD__ . '(): Running...' );
if ( is_user_logged_in () ) {
$user_id = get_current_user_id();
GFCommon::log_debug( __METHOD__ . '(): Adding customer id ' . $customer->id . ' to user ' . $user_id );
update_user_meta( $user_id, 'stripe_customer_id', $customer->id );
}
}

// Gets the current Stripe customer ID to change the billing details on. Tests if the user has an ID and is signed in.
add_filter( 'gform_stripe_customer_id', 'get_stripe_customer_id' );
function get_stripe_customer_id( $customer_id ) {
GFCommon::log_debug( __METHOD__ . '(): Running...' );
if ( is_user_logged_in () && get_user_meta( get_current_user_id(), 'stripe_customer_id', true ) != ''){
$user_id = get_current_user_id();
GFCommon::log_debug( __METHOD__ . '(): Getting customer id from user ' . $user_id );
$customer_id = get_user_meta( $user_id, 'stripe_customer_id', true );
GFCommon::log_debug( __METHOD__ . '(): Customer id set to: ' . $customer_id );
}
return $customer_id;
}

// Make a form that has a Stripe Product and Services feed, and make sure no payment is made.
add_filter( 'gform_stripe_charge_authorization_only', 'stripe_charge_authorization_only', 10, 2 );
function stripe_charge_authorization_only( $authorization_only, $feed ) {
GFCommon::log_debug( __METHOD__ . '(): Running...' );
$feed_name = rgars( $feed, 'meta/feedName' );
// The name associated with the Stripe feed.
if ( $feed_name == 'Update Billing' ) {
GFCommon::log_debug( __METHOD__ . '(): Authorization only for Update Billing feed.' );
return true;
}
return $authorization_only;
}

Conditional Logic Object

Conditional Logic Object

IntroductionUsagePropertiesRule Properties

Introduction

Conditional Logic, when applied to the form or page button or to any field, controls the visibility of that element based on a choice selected or value entered by the user in other fields on the form. It can also be used to determine if a notification, confirmation or add-on feed should be used.

12345678910111213array(    'conditionalLogic' => array(        'actionType' => 'show',        'logicType'  => 'all',        'rules'      => array(            array(                'fieldId'  => 2,                'operator' => 'is',                'value'    => 'Second Choice',            ),        )    ),);

Usage

12345678// returns the conditional logic rules for the form button$rules = rgars( $form, 'button/conditionalLogic/rules' ); // returns the conditional logic rules for the field$rules = rgar( $field->conditionalLogic, 'rules' ); // returns the conditional logic rules for the feed$rules = rgars( $feed, 'meta/feed_condition_conditional_logic_object/conditionalLogic/rules' );

Properties

actionType stringThe type of action the conditional logic will perform. Possible values: show, hide

show: Displays the field when the rules match and hides the field when the rules do not match
hide: Hides the field when the rules match and displays the field when the rules match

logicType stringDetermines how to the rules should be evaluated. Possible values: any, all

any: Evaluates the conditional logic to true if any of the rules match. More specifically, will OR the rules together (i.e. rule1 || rule2 || rule3)
all: Evaluates the conditional logic to true if all rules match. More specifically, will AND the rules together (i.e. rule1 && rule2 && rule3)

rules arrayAn associative array containing the conditional logic rules. See below for the individual rule properties.

Rule Properties

fieldId integer
Target field Id. Field that will have it』s value compared with the value property to determine if this rule is a match

operator string
Operator to be used when evaluating this rule. Possible values: is, isnot, >, <, contains, starts_with, or ends_with is: Evaluates this rule to true when the value property is equal to the value of field specified by fieldId. isnot: Evaluates this rule to true when the value property is not equal to the value of field specified by fieldId. value stringThe value to compare with field specified by fieldId

Gravity Forms 2.2: Changes to Entry IP Detection

Gravity Forms 2.2: Changes to Entry IP Detection

With the release of Gravity Forms version 2.2, changes have been made to the IP displayed when a form entry is generated.
Previously, Gravity Forms would check for the X-Forwarded-For header, and use that IP. This would allow for proxied connections such as Cloudflare to report the user』s IP, instead of showing the IP of the server making the request (such as Cloudflare).
To more accurately report IP addresses, this functionality has been removed. Entries will now show the IP address of the server physically making the request.
Of course, this can cause issues for some sites that are behind a reverse proxy. To solve this problem, we』ve placed a hook that will allow the the X-Forwarded-For header to be used. It can be found at the following:
gform_ip_address filter

Confirmations List Page

Confirmations List Page

ListingQuick Toobar ActionsConfirmation ColumnsEditing A ConfirmationDefault Confirmation

Listing

The Confirmation list page allows you to see all the confirmations for a particular form.

As of Gravity Forms 2.4, the list of confirmations may be sorted alphabetically by clicking on the 「Name」 column header.

Hovering over the confirmation name reveals the quick toolbar confirmation actions, each of which is described below:

Quick Toobar Actions

Active/Inactive: Active sets the current confirmation to use. Inactive means the confirmation is there but it is not currently in use.Edit allows to make any modifications to your confirmations.Duplicate will make a copy of that entire confirmation.Delete permanently removes the confirmation. This cannot be undone.

Confirmation Columns

Name of your confirmation. The list may be sorted alphabetically by clicking on the column header. Type: Different types of confirmations are listed. The Text confirmation will produce text you have entered in that field. The Page type links to the WordPress related page you have specified. The Redirect will redirect you to the URL you have provided. See Confirmation Settings for more information on types. Content is the information that is included in the type you have specified. Ex: Type (redirect) Content (http://www.google.com).

Editing A Confirmation

For information on configuring a confirmation, refer to this help article.

Default Confirmation

A form needs to always process one confirmation, and therefore the Default Confirmation cannot be deleted, removed, or inactivated.

To display a custom confirmation message, you will need to edit the Default Confirmation or create a new confirmation with conditional logic enabled appropriately. The Default Confirmation will be used if the logic fails on all other confirmations.

CleverReach Change Log

CleverReach Change Log

1.7 | 2020-09-081.6 | 2020-03-121.5 | 2019-02-191.4 | 2018-04-021.3 | 2017-05-161.2 | 2016-07-291.1 | 2015-06-021.0 | 2015-05-19

1.7 | 2020-09-08

Added support for Gravity Forms 2.5.
Fixed a PHP warning which occurs when accessing an existing feed after the add-on is connected to a different CleverReach account.

1.6 | 2020-03-12

Added translations for Hebrew, Hindi, Japanese, and Turkish.
Fixed a PHP 7.4 notice which occurs on the feed configuration page when saving a new feed.
Fixed an issue with the double opt-in email not being sent if the personal data settings for a form are set to prevent storage of user IP addresses.
Fixed a PHP warning which could occur during form submission.

1.5 | 2019-02-19

Updated Add-On to use CleverReach REST API.

1.4 | 2018-04-02

Added security enhancements.
Added Double Opt-In support when updating contact.
Added License GPL to plugin header.
Updated Plugin URI and Author URI to https.
Fixed a PHP warning which could occur during feed processing if Double Opt-In was enabled.
Fixed fatal errors which could occur when getting the choices for the Group and Double Opt-In settings.
Fixed a PHP warning which occurred when the CleverReach API did not return the requested group details.

1.3 | 2017-05-16

Updated warning message when SOAP extension is not present.
Fixed strings for translations.
Fixed fatal error which could occur when initiating the CleverReach API.
Fixed PHP notice.

1.2 | 2016-07-29

Added feed duplication support.
Added gf_cleverreach() for easily getting a CleverReach instance.
Added support for delaying feed processing until payment by PayPal Standard is successfully completed.

1.1 | 2015-06-02

Added Double Opt-In support.
Added Spanish (es_ES) translation.

1.0 | 2015-05-19

It's all new!

Configuring Notifications in Gravity Forms

Configuring Notifications in Gravity Forms

What Is A Notification?Create a New NotificationEnter the Email SettingsMessage and SubjectDisable Auto-FormattingAdding An AttachmentUsing Conditional Logic With The Notification

What Is A Notification?

When a user submits a form, it can be quite helpful for the site administrator to receive a notification that a form has been successfully submitted. This ensures that you do not have to constantly check your Entries table to see if anything has been submitted. In this article, we will show you how to configure a basic notification for one of your forms.

Note that as your needs evolve, you can have multiple notifications for a single form, and even for a single submission. Additionally, you can determine which is activated on submission using complex conditional logic conditions. But for now, let』s just create a simple notification.

Create a New Notification

You will need to already have a form created. If you need to learn how to do so, you may review our article on creating forms.

First, access the form that you want to create a notification for. This is done by clicking on Forms on the left side navigation menu, then clicking on your desired form.At the top menu, hover over Form Settings and click on Notifications.You should now see a list of all notifications that exist for that form. By default, there should already be a single notification that sends the submissions to the admin email address within your WordPress installation. The list may be sorted alphabetically by clicking on the 「Name」 header. To add a new notification, click the Add New button.First, pick a name for your notification. This is simply something to easily identify the notification. Any unique name will be fine.

Enter the Email Settings

You will see a setting labeled Send To. This allows you to determine how the message is sent. The options available are the following: Enter Email: This is simply a single email address that all notifications for this form will be sent to.Select a Field: This option will allow you to send the notifications based on the contents of an email address field in the form.Configure Routing: This option will allow you to change the Send To email address used for the notification based on the options that the user selects in the form.For the purpose of this article, we are just going to take a look at the Enter Email option.When you have the Enter Email option selected, the Send to Email field will be available. Within this field, enter the email address that you want your form notifications to be sent to. You will need to configure a few different fields related to the email being sent. The first of these is the From Name field. When a notification email is sent, this is the name that will be displayed as the sender. Here, you can set this to something static, or dynamically generate that data. In this example, we want the name field from the form to be used as the From Name in the notification, click on the merge tag icon to the right of the field, and click on the field that you are using for the name. The number in the merge tag is the value of the field_id. Example: {text:4} will select field ID 4. {name:5.3} will target the 3rd subfield of the field ID 5. For more information on merge tags, refer to this article. Next up is the From Email field. This is the email address that is displayed as the sender when receiving the notification. You may set this to {admin_email} or use a static email address, but always use a valid from email to prevent sending and deliverability issues.There is also the Reply To field in which the reply address may be set. This can take a static email address, or use merge tags by clicking on the icon to the right of the field.The BCC field will allow you to set an email address in which the notification email will be copied to. This is useful if you have an individual that wants to receive all notification emails when sending to multiple people.

Message and Subject

The Subject and Message fields are the most important part of the notification. This is the content that lets you know the content of the form that was filled out. These default to a subject stating the form that was filled out, as well as the message containing the form content. Just like many of the previous fields, these also support merge tags to dynamically generate content. For most people, the default content is fine, but you may change this to anything you wish. Using the drop down icon next to the input boxes, you can select your form fields merge tags and also additional merge tags.

Disable Auto-Formatting

WordPress runs a function to help add paragraph spacing to your email text in order to help readability. If you』ve carefully crafted your notification layout (e.g. using HTML) and do not want any meddling from the system, select the Disable Auto Formatting checkbox below the message field.

Adding An Attachment

As of Gravity Forms 2.4, if there are File Upload fields on the form, the Attachments option displays. By selecting this option, the files that are uploaded on the form are included when the Notification is sent.

Using Conditional Logic With The Notification

Notifications support conditional logic, allowing you to define specific conditions that determine whether or not this notification gets sent. Select the option to enable conditional logic here, you can then configure your conditions. For more information on conditional logic, take a look at our article on configuring conditional logic.

Checkboxed Select Field

Checkboxed Select Field

IntroductionExampleUses

Introduction
The checkbox_and_select type field, part of the Settings API, renders a checkbox which when checked will display a drop down with additional options.
Example
123456789101112131415161718192021222324252627array(    'title'  => esc_html__( 'This is the title for Section 1', 'sometextdomain' ),    'fields' => array(        array(            'name'     => 'updateContact',            'label'    => esc_html__( 'Update Contact', 'sometextdomain' ),            'type'     => 'checkbox_and_select',            'checkbox' => array(                'name'  => 'updateContactEnable',                'label' => esc_html__( 'Update Contact if already exists', 'sometextdomain' ),            ),            'select'   => array(                'name'    => 'updateContactAction',                'choices' => array(                    array(                        'label' => esc_html__( 'and replace existing data', 'sometextdomain' ),                        'value' => 'replace'                    ),                    array(                        'label' => esc_html__( 'and append new data', 'sometextdomain' ),                        'value' => 'append'                    )                )            ),        ),    ),),
The above code would render a field similar to the following:

Uses

settings_checkbox_and_select()
settings_checkbox()
settings_select()

Conditional Shortcode

Conditional Shortcode

IntroductionUsageExamplesShow content if a certain checkbox was checkedShow content if a certain field is not emptyShow content based on the price for a product field set to Radio Buttons type.

Introduction
The conditional shortcode allows you to perform conditional logic in the message content of your Admin and User Notification emails as well as the Confirmation Message that is displayed when a form is submitted.
The conditional shortcode consists of an opening and closing shortcode. Any text or content contained within the opening and closing conditional shortcode will be the content that is conditionally displayed.

Please note: Nested conditional shortcodes are not supported at this time.

Usage
[gravityforms action="conditional" merge_tag="{Number:1}" condition="greater_than" value="3"]
Content you would like to conditionally display.
[/gravityforms]

action
The action you would like to perform. This must be set to conditional as in the example above. (required)
merge_tag
The form merge tag who』s value you are executing the conditional logic for. You can get the correct merge tag for the form data you would like to use using the insert merge tag drop down. (required)
condition
The type of condition used to determine success. Available conditions are: is, isnot, greater_than, less_than, contains, starts_with, ends_with. (required)
value
The value that the condition must equal in order for the condition to be met and the content displayed. (required)

Examples
Show content if a certain checkbox was checked
In this case we use the :value modifier to ensure we』re checking the value (that can be different from the label). And we』re using the 「contains」 condition instead of 「is」 because the value for a checkboxes field can contain different choices separated by a comma.
[gravityforms action="conditional" merge_tag="{Checkboxes:1:value}" condition="contains" value="10"]
This content would be displayed if the value of field id 1 has a 10.
[/gravityforms]

Show content if a certain field is not empty
In this example, we want to show our content only if a Text field with id 5 is not empty.
[gravityforms action="conditional" merge_tag="{Text:5}" condition="isnot" value=""]
This content would be displayed if a value exists for field id 5.
[/gravityforms]

Show content based on the price for a product field set to Radio Buttons type.
In this example, we want to show our content only if the choice selected has a price of 3. Note the use of the :price merge tag modifier, and the lack of the currency symbol for the value.
[gravityforms action="conditional" merge_tag="{Radio Product:5:price}" condition="is" value="3"]
This content would be displayed if the choice selected has a price of 3.
[/gravityforms]

Changes to Stripe Checkout with Stripe Add-On v3.0

Changes to Stripe Checkout with Stripe Add-On v3.0

IntroductionBest PracticesChanges to the Stripe Checkout processRemoval of the Modal WindowCheckout StylingChanges to FiltersRemoved FiltersModified FiltersScreenshots

Introduction
Version 3 of the official Gravity Forms Stripe Add-On made a number of changes to bring our add-on into line with Stripe』s updates around Strong Customer Authentication and their new API. Please review this document carefully, as your existing flow using Stripe Checkout or Stripe filters may have been affected.
Best Practices
The payment gateway add-on is a vital cog in any website, and as such you should never run updates without testing in a sandbox first. We always recommend that you:
– make a complete backup that can be used as a restore point
– switch to sandbox payment environment, and test the update first
– once satisfied, don』t forget to switch back to your production environment before you start collecting live payments.
Be cautious. Be prepared.
Changes to the Stripe Checkout process
Removal of the Modal Window
If you use the Stripe Checkout method, then Stripe Add-On 3.0 will modify your payment flow. With their recent API updates, Stripe have replaced the modal window with a full page display for the final portion of the checkout process. See screenshots at bottom for examples.
Checkout Styling
All styling options for this new window now take place in Stripe under your Branding section. All styling options that previously existed within the Stripe Add-On Feed Settings area have been removed in version 3.
Changes to Filters
We have added some new filters with this update (see the Change Log), but also removed and modified some existing hooks to orient with Stripe』s API updates.
Removed Filters

gform_stripe_currency (added in 2.7)
gform_stripe_checkout_options (added in 2.6)
gform_stripe_checkout_supported_cards

Modified Filters

gform_stripe_charge_pre_create no longer works with Stripe Checkout. Use gform_stripe_session_data to replace it.

Screenshots
Screenshot A: Deprecated Stripe Checkout Modal Window

Screenshot B: New Stripe Checkout Page

Screenshot C: New Stripe Checkout Page, with billing address