Option to Delay PDF Generation After Submit Button has been Press

Gravity Forms
September 16, 2021 12:22:18
k12tot
Topics: 2
Messages: 4
Hi Guys,

First off, Great Plugin - One of the best if not the best.

I have users filling out Gravity forms 20+ times per day and as we add new options to the gravity forms it now taking too long for the form submittion - in somes cases over 60 seconds. As you can imagine this is fustrating for the end users who are out on sites doing this on their iPads etc.

Can we look at getting a way to delay the PDF generation so it runs as a backgroud task to drastically speed up the submittion time.

Any feedback or a snippit to add this in would be great.

Thanks!
September 17, 2021 00:21:45
E2Pdf
Topics: 7
Messages: 3614
Support
Hi, thank you.

Unfortunately by default all notifications fires on form submission and due the way of PHP working - it will output "Success Message" and finish it only when all functions (including PDF generation and sending emails) will be completed.

There are some possible solutions:

1st possible solution: Build custom cron job by following the current logic:
- You add some hidden field inside form which by default for example has '0' as default value.
- You create "custom" action and connect notification to it, so after first submission emails will not be sent: https://docs.gravityforms.com/gform_notification_events/.
- Via custom cron job file (recommended) or wordpress cronjob functionality you get entries which has this hidden value set to '0', update hidden value to '1', trigger sending notification event via https://docs.gravityforms.com/api-functions/#send-notifications.

2nd possible solution: Use async emails plugin with WordPress or only for Gravity Forms (if possible). In this case all [e2pdf-attachment] shortcodes must be converted to [e2pdf-save id="1" attachment="true" overwrite="false"] as async emails will require PDF file to exist if it will be delayed output. In most cases such plugins using WordPress cron job functionality.

3rd possible solution: Try to optimize email actions but it could work only if you have multiple actions under Gravity Forms with same [e2pdf-attachment] shortcodes. For example you can try to use [e2pdf-save id="1" attachment="true" overwrite="false"] instead of [e2pdf-attachment id="1"]. PDF will be generated only 1 time, saved and exactly this saved PDF will be used as attachment for all other shortcodes with same attributes.

P.S. Keep attention please that if you will be using [e2pdf-save] shortcode - PDF Name must be set to unique name for each submission, for example it's possible to use {entry_id} as name (screenshot attached)

We remain at your service.

We would really appreciate your feedback at WordPress.org!
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.