Skip to content

Commit

Permalink
Merge pull request #274 from infinum/feature/variations
Browse files Browse the repository at this point in the history
docs
  • Loading branch information
iruzevic authored Sep 27, 2023
2 parents e86295b + 0291162 commit ff36906
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions website/forms/features/success-redirect.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,49 @@
id: success-redirect
title: Success redirects
---
By default, when you submit a form, a success message is displayed on the same page. If you want to redirect the user to a different page, you can enable the _Success redirects_ feature. This option can be found in each integration's Form settings, or in Global settings.

*Coming soon*
Variation and template tags can enrich the "thank you" pages, and make them more personal.

![Success redirects screen](/img/forms/success-redirects.webp)
## Template tags

The data entered by the user is sent to the "Thank you" page in the form of `GET` parameters. By default, no parameters are sent, to prevent sending any data that is not meant to be forwarded. In the Form settings the parameters that are passed through can be selected.

Chosen parameters can be used as _magic variables_ on the destination side. They are wrapped inside curly brackets, with the field name inside, e.g. `{name}`, `{email}`, ...
![Success redirects settings screen](/img/forms/success-redirects-settings.webp)

## Variations

Just like Template tags, variations are also passed to the "Thank you" page as a `GET` parameter. However, instead of using the entered data, they are pre-defined in the form settings, and can be used to add more granular control to the design and/or content of the "Thank you" page.
Template tags and variations are features that allow passing data to the success page. However, variations are predetermined in the form settings and are used to differentiate between various versions of the success page.

When enabled, a `es-variation` GET parameter is added to the "Thank you" page URL, with the value being the ID of the chosen variation.

:::note
The value must be encoded, which can be done with the `esFormsDecryptor` [helper](/forms/php/helpers#esformsdecryptor).
:::

### How to use a variation

To use variations, a list of variations needs to be added in the Global settings. Then, the variations can be chosen both in Form settings and through the Block editor.

### Block editor options

When selecting a form in the Block Editor, you will find multiple additional options to enrich your user experience.

**Options available in the Block Editor:**

* **Variant** - this option will override the variant set in the form settings. This way, you can use one form in multiple places with different variants.
* **Enrichment** - this option will add additional data to your success URL.
* * **Url** - this option will set a simple URL to pass.
* * **Url title** - this option will set a title for the URL if you want to populate a button.
* * **Media** - this option will allow you to add unlimited media files to the success page. For example if you want a user to download a file after submitting a form.
* * **Media item conditional field**s - just like template tags, you can use simple conditional tags here to show or hide media items based on the user input. E.g., `field_name=filed_value`. If you want to show a media item in any case, you can use the `all` value.
* * **Media item title** - just like the url title, this option will set a title for the media item.

![Success redirects screen](/img/forms/success-redirects.webp)

:::caution
At this point, you must manually create a success page block that can use variations options. We are working on a solution to automate this process.
:::

0 comments on commit ff36906

Please sign in to comment.