Gravity Forms, confirmation page and shortcode

Gravity Forms
August 15, 2020 14:02:07
chenovazquez
Topics: 1
Messages: 3
Dear all,

Thank you for the great plugin.

I have one doubt which may be easy to solve, but which is driving me crazy.

I have created a form with Gravity Form, which fills a PDF. When I include the shortcodes in the confirmation message provided by Gravity Forms, everything works great and the user is able to view or download the PDF which he has completed. However, when I select in Gravity Form a confirmation page (instead of a confirmation message), the shortcodes are not working (the links are not appearing).

I guess I am doing something wrong in the query string section. I attach a picture of my current configuration. Could you kindly confirm: (i) whether it is possible to allow the user to view or download his PDF entry in a page (instead of in a confirmation message) and (ii) which additional information should I include in the query string in order to make this work?

Thank you very much.

Best reagrds,
August 15, 2020 18:19:19
E2Pdf
Topics: 7
Messages: 3614
Support
Hi,

Unfortunately yes, shortcode will not work in this case as E2Pdf doesn't know for which entry it must be generated download link as Gravity Forms doesn't send this information by default, however it must be possible to complete the task with some PHP hooks. Our dev team will review your question on Monday / Tuesday and we hope will get solution for you.

We remain at your service.

We would really appreciate your feedback at WordPress.org!
August 16, 2020 07:11:18
chenovazquez
Topics: 1
Messages: 3
Thank you very much for checking this. Looking forward to hearing from you.
August 17, 2020 09:39:30
E2Pdf
Topics: 7
Messages: 3614
Support
Hi,

Here is an example how to complete the current task:

1. It was created "Hidden" field under forms with name "Entry Key". There will be saved Unique Entry Key generated upon submission so we can identify entry and avoid users view other entries by changing Entry ID inside URL (screenshot 1).

2. It was added redirect with query parameters to bypass "Entry Key" (screenshot 2)

3. It's need to add custom shortcode: [e2pdf-gravity-entry-download] to the page to which user will be redirected with "Entry Key" parameter. (screenshot 3)

4. Copy code to your functions.php: https://codeshare.io/2E7JlO.

It contains:

- generation of Entry Key and updating entry on form submission, keep attention on action name (gform_pre_submission_6), 6 must be changed to your form id and $field_id must be changed to your hidden field id which will contain Entry Key.

- custom shortcode (e2pdf-gravity-entry-download) function, which will parse entry_key and convert it to entry_id with render of "e2pdf-download" shortcode. There must be changed $form_id, $field_id and $template_id,

Let us know please if you will face any issues with implementation.

We remain at your service.

We would really appreciate your feedback at WordPress.org!
August 17, 2020 15:33:52
chenovazquez
Topics: 1
Messages: 3
Thank you very much, this works perfectly. Much appreciated. Thank you for the great support.
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.